Skip to content

Commit 3fcea16

Browse files
author
Christoph Bühler
committed
fix(readme): add docs, add correct ver 1.0.0
1 parent e4563d4 commit 3fcea16

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
11
# node typescript parser
22

3+
This package is a TypeScript and ECMAScript parser. It uses the underlying typescript parser to generate
4+
a more or less human readable AST out of .js or .ts files.
5+
6+
[![Build Status](https://travis-ci.org/TypeScript-Heroes/node-typescript-parser.svg)](https://travis-ci.org/TypeScript-Heroes/node-typescript-parser)
7+
[![npm](https://img.shields.io/npm/v/typescript-parser.svg?maxAge=3600)](https://www.npmjs.com/package/typescript-parser)
8+
[![Coverage status](https://img.shields.io/coveralls/TypeScript-Heroes/node-typescript-parser.svg?maxAge=3600)](https://coveralls.io/github/TypeScript-Heroes/node-typescript-parser)
9+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
10+
311
## How to use
12+
13+
After you install the package via:
14+
15+
[![NPM](https://nodei.co/npm/typescript-parser.png?downloads=true&stars=true)](https://nodei.co/npm/typescript-parser/)
16+
17+
You can use the parser with:
18+
19+
```typescript
20+
const parser = new TypescriptParser();
21+
22+
// either:
23+
const parsed = await parser.parseSource(/* typescript source code as string */);
24+
25+
// or a filepath
26+
const parsed = await parser.parseSource('/user/myfile.ts', 'workspace root');
27+
```
28+
29+
You can also parse multiple files at ones.
30+
31+
To use the declaration index (which is basically a list of symbols for your files)
32+
instantiate an index first and throw him some files.
33+
34+
After the parsing is done, you'll get an index with resolved
35+
exports and declarations.
36+
37+
Keep in mind, that the index'll only contain exported declarations.
38+
39+
## Changelog
40+
41+
The changelog is generated by [semantic release](https://github.com/semantic-release/semantic-release) and is located under the
42+
[release section](https://github.com/TypeScript-Heroes/node-typescript-parser/releases).
43+
44+
## Licence
45+
46+
This software is licenced under the [MIT](LICENSE) licence.

0 commit comments

Comments
 (0)