TypeScript reimplementation of Tweego — a command-line compiler for Twine/Twee interactive fiction projects.
Zero runtime dependencies. Node.js 22+.
npm install @rohal12/twee-tsnpx @rohal12/twee-ts --init # scaffold a new project
npx @rohal12/twee-ts -o story.html src/ # compile
npx @rohal12/twee-ts -w -o story.html src/ # watch modeOr with a config file (twee-ts.config.json):
{
"sources": ["src/"],
"output": "story.html"
}npx @rohal12/twee-tsimport { compile } from '@rohal12/twee-ts';
const result = await compile({
sources: ['src/'],
tagAliases: { library: 'script' },
});// vite.config.ts
import { tweeTsPlugin } from '@rohal12/twee-ts/vite';
export default {
plugins: [tweeTsPlugin({ sources: ['src/'] })],
};Also available: @rohal12/twee-ts/rollup.
Full docs at rohal12.github.io/twee-ts:
- Getting Started
- CLI Reference
- Configuration
- Tag Aliases
- Programmatic API
- Vite & Rollup Plugins
- Story Formats
- Packaging Formats
pnpm install
pnpm test # run tests
pnpm run typecheck # type-check
pnpm run build # bundle
pnpm run docs:dev # local docs dev server
pnpm run docs:build # build docs for deploymentThis is free and unencumbered software released into the public domain. See UNLICENSE.