Diullei / ts-emitter

Emitting typescript AST back to typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ts-emitter

GitHub license npm Travis codecov Commitizen friendly Standard Version renovate badge

Emitting typescript as back to typescript.

Features

  • Keep original source as much as possible and only update whats changed.

Usage

Installation

Install as npm package:

$ npm install ts-emitter

Tests

The typescript compiler test suite is used to test the code generator. To create and run the test harness execute

$ npm run update-harness[coverage-image]: https://coveralls.io/repos/github/KnisterPeter/ts-emitter/badge.svg?branch=master
55
[coverage-link]: https://coveralls.io/github/KnisterPeter/ts-emitter?branch=master
56
​
57
​
58
​
59

$ npm run harness

API

  import { fromPath, toSource } from 'ts-emitter';

  const ast = fromPath('path/to/source-file.ts'));
  // Do something with the AST
  const source = toSource(ast);

About

Emitting typescript AST back to typescript

License:MIT License


Languages

Language:TypeScript 97.0%Language:JavaScript 2.6%Language:Shell 0.4%