Tweenode - A neat JS wrapper for Tweego

Easily download and setup Tweego, then compile using a JS API

Why:

I wanted an easy way to use Tweego as part of a more complex pipeline For example, bundling with Webpack or Rollup And an automatic way to set up Tweego for any project, making getting started with contributions thought git as simple as using npm install On my testing, it seems stable enough, but testers and bug reports are appreciated, as well as suggestions

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',
  },
})

Links

Repo: GitHub - greatsquare0/tweenode: A neat JS wrapper for Tweego
NPM: tweenode - npm

3 Likes

I’ve been interested in ways to integrate Twine and JS more easily, and this seems like it could be useful. Thanks for posting it here–may try it later. (Also, welcome to the forum!)

2 Likes