typescript-parser

Parser for typescript (and javascript) files, that compiles those files and generates a human understandable AST.

MIT 24 个版本
安装
npm install typescript-parser
yarn add typescript-parser
pnpm add typescript-parser
bun add typescript-parser
README

node typescript parser

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

Build Status Build Status Windows npm codecov semantic-release Greenkeeper badge Gitter

How to use

After you install the package via:

NPM

View Source Docs

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');

You can also parse multiple files at ones.

To use the declaration index (which is basically a list of symbols for your files) instantiate an index first and throw him some files.

After the parsing is done, you'll get an index with resolved exports and declarations.

Keep in mind, that the index'll only contain exported declarations.

Changelog

The changelog is generated by semantic release and is located under the release section.

Licence

This software is licenced under the MIT licence.

版本列表
2.6.1 2018-08-31
2.6.0 2018-08-31
2.5.0 2018-07-05
2.4.0 2018-04-04
2.3.1 2018-03-06
2.3.0 2018-03-05
2.2.2 2017-10-30
2.2.1 2017-10-29
2.2.0 2017-10-28
2.1.0 2017-10-26
2.0.1 2017-10-03
2.0.0 2017-10-03
1.3.3 2017-09-19
1.3.2 2017-09-18
1.3.1 2017-09-08
1.3.0 2017-08-09
1.2.1 2017-07-15
1.2.0 2017-07-11
1.1.0 2017-07-10
1.0.1 2017-07-04
1.0.0 2017-07-04
0.0.1 2017-06-21
0.0.0 2017-07-04
0.0.0-development 2017-07-04