npm.io
0.1.4 • Published 3 years ago

parse-ts-to-ast

Licence
MIT
Version
0.1.4
Deps
4
Size
253 kB
Vulns
0
Weekly
0

typescript parser

This package is a TypeScript parser. It uses the underlying typescript parser to generate a more or less human-readable AST out of .ts files.

How to use

After you install the package via:

npm i parse-ts-to-ast

You can use the parser with:

const parser = new TypescriptParser();

// either:
const parsed = await parser.parseSource(/* typescript source code as string */);

// or a filepath
const parsed = await parser.parseFile('/user/myfile.ts', 'workspace root');

Licence

This software is licenced under the MIT licence.

Keywords