ENtity Relationship Extractor for ECMAScript and TypeScript based on @babel/parser.
By doing static code analysis, ENRE-ts extracts entities and relations between them (aka code dependencies), to help developers have a better and clearer view of understanding on code repos they are dealing with.
-
📃 Conforms to the latest ECMAScript/TypeScript and Node.js specification
-
📦 Out-of-the-box support for monorepo projects
-
📐 Highly standardized, documentations are comprehensive and publicly available
-
🔌 Supports multiple usage patterns, including CLI and programmatic interfaces
-
For command line use, run the following command to install ENRE-ts as a npm global package.
$ npm install -g @enre/cli
Then run
@enre/cli
ornpx @enre/cli
to access command line usage. -
For embedding enre-ts into your application directly through programmatic interfaces, in application's directory, run:
$ npm install @enre/core @enre/container @enre/naming @enre/location
to install all dependencies that you would probably use.
Then use following imports (ESM style) to gain access to core functionalities and containers:
// Entity container and relation container respectively import {eGraph, rGraph} from '@enre/container'; // Core analyse interface import usingCore from '@enre/core'; // Set preferences like log level and etc. import {preferences} from '@enre/core'
From assets of the
latest release,
download the file named with enre-ts-x.x.x.js
, then run it with
the following command:
$ node enre-ts-x.x.x.js
From assets of the
latest release,
download the file named with enre-ts-x.x.x.exe
(Windows 10+),
then run it with the following command:
> ./enre-ts-x.x.x.exe
Append -h
or --help
without any other arguments to see list
of options:
Usage: enre-ts [options]
An open source entity relationship extractor for ECMAScript and TypeScript.
Options:
-V, --version output the version number
-i, --input <path> specify the path to a file or directory (default: ".")
-o, --output <path> specify where to output the analyse results (default: ".")
-e, --exclude <relative-path...> specify files or directories to be excluded during analysis
-m, --multi-thread enable to use multi thread to speed up analyse processing (default: false)
-v, --verbose enable to print more message while processing (default: false)
-h, --help display help for command
- Analyse files under a given directory (and output results in current working directory)
$ node enre-ts.js -i path/to/directory
- Analyse a file and output results in given directory/file
$ node enre-ts.js -i path/to/file.js -o path/to/output/result.json
- Analyse files under a given directory and enable verbose logging
$ node enre-ts.js -i path/to/directory -v
Specifications on which kinds of entities and relations can be captured and any other details can be found in docs.
After cloning this repository, run npm install
to install all
dependencies.
- For developing functionalities, run
npm start
- For writing documents and testing, run
npm pretest
andnpm test
- For publishing bundled file, run
npm run bundle:core
- For publishing prebuilt executable,
run
npm run bundle:core:xxx