@neuledge/typescript-states
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

Neuledge Typescript States

A TypeScript code generator for Neuledge Engine "*.states" files.

This library is not intended to be used directly. It is a dependency of the main package.

📦 Installation

npm install @neuledge/typescript-states

🚀 Getting started

import { generate } from '@neuledge/typescript-states';
import { StatesContext } from '@neuledge/states';
import { promises as fs } from 'fs';

// create a state context and load a state file
const ctx = new StatesContext();
await ctx.load([{
  source: await fs.readFile('posts.states', { encoding: 'utf8' }),
  filePath: 'posts.states',
}]);

// generate TypeScript code from the state context
await fs.writeFile('states.generated.ts', generate(ctx));

📄 License

Neuledge is Apache 2.0 licensed.

Package Sidebar

Install

npm i @neuledge/typescript-states

Weekly Downloads

2

Version

0.2.2

License

Apache-2.0

Unpacked Size

251 kB

Total Files

64

Last publish

Collaborators

  • moshe