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