0.2.0 • Published 6 years ago

tl-transform v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

tl-transform

npm

Translates TL to TypeScript / Flow.

Installation

$ npm i tl-transform

Usage

From command line

Flow / TypeScript

$ npx tl-transform schema.tl > a.js
# or
$ npx tl-transform schema.tl > a.ts

From JavaScript

import fs from 'fs'
import { transform } from 'tl-transform'
// function transform: (src: string, cfg?: Config) => string

const source = fs.readFileSync('schema.tl').toString()
const output = transform(source)
console.log(output)

See also config.js.

Examples

See l82.js.