This is a JavaScript/TypeScript parser written in Java.
I wrote this project to satisfy the problem of parsing JS/TS code in Java (even Nashorn doesn't do this well, or for modern dialects).
This parser should be able to process valid JavaScript and TypeScript. It should fully support ES6 features.
- Desctructuring operations
- Optimize JS ASTs
- Interpert generated ASTs
- Compile generated ASTs to Java bytecode
- Transpile to another dialect of ECMAScript (e.g., TypeScript 1.8 -> ES5)
- Format JavaScript prettily
but could, if people express interest:
- Automatic semicolon insertion
- Identifiers named certain keywords (e.g.,
of
is reserved by me for for-of loops. However, you can dowindow['of']
to access it)
(before the next release):
- Perfect Unicode support
- Some non-strict things