Skip to content

greatsquare0/tweenode

Repository files navigation

Tweenode

A neat NPM package and wrapper for Tweego, downloads binaries from Tweego repo and expose a JS API

Version JSON Badge CI Workflow Status Build Workflow Status

Now on beta!

Aimed to be used with build scripts for more complex stories

Basic usage

import { Tweenode, setupTweego } from 'tweenode'

// Will create a folder called .tweenode and download Tweego to it
// Won't download again if the folder is already there
await setupTweego()

// Instantiate Tweenode, you can pass some setup configs
const tweego = new Tweenode()

await tweego.process({
  input: {
    storyDir: 'path/to/story',
  },
  output: {
    mode: 'file', // Write to a file or return as a string
    fileName: 'path/to/output.html',
  },
})

Compatibility

x86_64 Arm
Windowns
Linux
MacOS

✅ = Tested | ❔ = Untested | ❌ = Don't work

To run on arm, emulation may be needed

See Tweego OS compatibility


Build from source

Requirements:

# install dependencies
pnpm install

# test the library with Vitest
pnpm run test

# build the library, available under dist
pnpm run build

Special thanks to these projects (And the people behind them):

Tweego by tmedwards

sugarcube-starter by nijikokun (Main source of inspiration)

tweego-bin by double-a-stories

tweego-node by mattrossman

License

MIT

Disclaimer

This project is not affiliated or endorsed by Twine or The Interactive Fiction Technology Foundation


Created with Bun-lib-starter