Modular Visual Novel SDK for the Web — build interactive visual novels with JavaScript.
VN-Sutra is a modular Visual Novel SDK that helps you author and ship browser-based visual novels. It provides:
- Modular game and UI modules in
vnsutra_modules/. - A story scripting system, assets pipeline, and save/load utilities.
- Local development tooling (dev server, Tailwind CSS watch, hot reload).
This repository includes an Express-based api/ server used for local development and packaging, plus build scripts for production bundles.
For editor support while working on .vn story files, use the companion VS Code extension: VN-Sutra Language Tools.
It is built specifically for .vn files and provides:
- Syntax highlighting for scene headers, shorthand commands, dialogue, variables, and
@actions. - Autocomplete for scene names, actor names, variables, assets, choice options, and common
@actionkeys. - Lint diagnostics for scene placement, flow-control alignment, indentation rules, choice nesting, and unknown lines.
- Starter snippets for common VN-Sutra patterns such as scene headers,
if/elseblocks, choice blocks, and generic@actions. - Command:
VN-Sutra: Create New VN Projectto bootstrap a fresh project from the latest VN-Sutra source release. - Command:
VN-Sutra: Run Project Setupto runnpm installandnpm run devin a single terminal. - Commands:
VN-Sutra: Run npm ScriptandVN-Sutra: Refresh npm Script Commandsfor dynamic script execution frompackage.json. - Dedicated
.vnfile icon contribution for clearer story-file visibility in the explorer.
Install dependencies and run the full local development environment:
npm install
npm run devWhat this runs (concurrently):
dev:server— Express dev server withnodemon(api/dev.js)dev:css— Tailwind CSS watch that compilescss/input.css→css/output.cssdev:reload— simple reload server (dev-server.js) used by the UIstory:watch— watches story files and rebuilds during editing
Open http://localhost:3000 (or the port printed by api/dev.js).
Prerequisites:
- Node.js 20.x (per
enginesinpackage.json) - npm 8+ (or yarn/pnpm)
Install dependencies:
npm installBuild production CSS once (optional):
npm run build:cssLocal development commands (high-level):
npm run dev— Start all dev helpers (server, CSS watch, reload, story watch).npm run dev:server— Start only the Express dev server (api/dev.js) withnodemon.npm run dev:css— Tailwind CSS watch mode.npm run dev:reload— Start the reload helperdev-server.js.
Build commands:
npm run build— Full build: story build, UI build, thenscripts/build.js.npm run build:bundle— Build + webpack production bundle + bundle script.npm run build:css— Compile and minify CSS for production.
Notes:
- The dev server serves
api/routes and static assets; see api/index.js and api/dev.js. - The UI build pipeline is in
scripts/ui-build.jsandwebpack.config.cjs.
- Run tests:
npm test - Run tests with coverage:
npm run test:coverage - Lint:
npm run lint— autofix withnpm run lint:fix - Format:
npm run format
The repository uses Jest for unit and integration tests; many tests live in tests/.
Contributions are welcome. Recommended workflow:
- Fork the repo and create a topic branch.
- Run
npm installandnpm run devto verify dev experience. - Add tests where applicable and run
npm test. - Open a pull request describing the change.
Please follow the coding conventions (ES modules, JSDoc for public APIs). Pre-commit hooks are enabled via husky and lint-staged.
api/— Express server and development entry pointsvnsutra_modules/— Core SDK modules used by gamesscripts/— Build scripts (story-build.js,ui-build.js,build.js)css/input.css→css/output.css— Tailwind input/output
Here are some screenshots of the vnsutra demo game:
This project is licensed under the MIT License. See the LICENSE file for details.








