Installation

VSN.js works best when you can drop it into an existing SSR page. Use the CDN for the fastest setup, or use NPM if you’re bundling or extending it.

<script type="module" src="https://unpkg.com/vsn/dist/index.min.js" auto-mount></script>

This auto-mounts when the DOM is ready and applies your behaviors.

NPM + bundler

npm i vsn
import { Engine } from "vsn";

const engine = new Engine();
engine.registerBehaviors(source);
engine.mount(document.body);

Use this approach if you want to register custom flags or attributes, or if you already have a bundler pipeline.

Auto-mount vs manual mount

  • auto-mount: add the auto-mount attribute on the script tag.
  • manual: import Engine and call mount yourself.

Versioning

VSN.js is still evolving. Pin versions in production if you want stability:

npm i vsn@0.x

Creator
Notes from the creator
VSN isn’t a framework. It’s a lifestyle.