@rohal12/twee-ts
v1.13.0
Published
TypeScript Twee-to-HTML compiler — a complete reimplementation of Tweego
Maintainers
Readme
twee-ts
TypeScript reimplementation of Tweego — a command-line compiler for Twine/Twee interactive fiction projects.
Zero runtime dependencies. Node.js 22+.
Install
npm install @rohal12/twee-tsQuick Start
npx @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-tsProgrammatic API
import { compile } from '@rohal12/twee-ts';
const result = await compile({
sources: ['src/'],
tagAliases: { library: 'script' },
});Build Plugins
// vite.config.ts
import { tweeTsPlugin } from '@rohal12/twee-ts/vite';
export default {
plugins: [tweeTsPlugin({ sources: ['src/'] })],
};Also available: @rohal12/twee-ts/rollup.
Documentation
Full docs at rohal12.github.io/twee-ts:
- Getting Started
- CLI Reference
- Configuration
- Tag Aliases
- Programmatic API
- Vite & Rollup Plugins
- Story Formats
- Packaging Formats
Development
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 deploymentLicense
This is free and unencumbered software released into the public domain. See UNLICENSE.
