Skip to content

rohal12/twee-ts

Repository files navigation

twee-ts

npm CI bundle size zero dependencies TypeScript node last commit license

TypeScript reimplementation of Tweego — a command-line compiler for Twine/Twee interactive fiction projects.

Zero runtime dependencies. Node.js 22+.

Documentation

Install

npm install @rohal12/twee-ts

Quick 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 mode

Or with a config file (twee-ts.config.json):

{
  "sources": ["src/"],
  "output": "story.html"
}
npx @rohal12/twee-ts

Programmatic 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:

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 deployment

License

This is free and unencumbered software released into the public domain. See UNLICENSE.

About

TypeScript based tweeo compiler

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages