Parse TypeScript code into ESTree-compatible abstract syntax tree.
Fork of @typescript-eslint/typescript-estree
to run on the web.
Install from NPM module.
npm install --save @expreva/tstree
It's installed in node_modules/@expreva/tstree
.
The module is built for these targets.
By using import '@expreva/tstree'
, it loads from build/esm
.
By using require('@expreva/tstree')
, it loads from build/cjs
.
A minified bundle is provided in build/web
.
- Copy
tstree.js
, load script in HTML, and use globaltstree
- Copy
tstree.js.map
for source map
For example, an NPM script in package.json
could copy to your project's public
folder.
{
"scripts": {
"copy": "cp node_modules/@expreva/tstree/build/web/tstree.* ./public"
}
}
import tstree from '@expreva/tstree'
tstree.parse(`
const message: string = 'Hello';
console.log(message)
`) // Syntax tree
-
Forked from
typescript-eslint
at version6.1.0
-
Split off the
typescript-estree
package usinggit-filter-repo
(Splitting a subfolder out into a new repository)git clone https://github.com/typescript-eslint/typescript-eslint tstree cd tstree git filter-repo --path packages/typescript-estree
-
Make it run in browser: Remove use of
fs
,is-glob
,globby
; Shim use ofpath
-
Copy shared TypeScript config files
-
Make it build: Migrate to
esbuild
to bundle for web, CommonJS, and ES Module -
Publish NPM module
@expreva/tstree