https://github.com/demoorjasper/import-grapher
Generates a dependency tree based on a js entrypoint
https://github.com/demoorjasper/import-grapher
dependencies js nodejs parcel
Last synced: about 2 months ago
JSON representation
Generates a dependency tree based on a js entrypoint
- Host: GitHub
- URL: https://github.com/demoorjasper/import-grapher
- Owner: DeMoorJasper
- License: mit
- Created: 2018-05-21T16:36:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-19T10:05:34.000Z (almost 8 years ago)
- Last Synced: 2025-02-23T21:22:56.704Z (over 1 year ago)
- Topics: dependencies, js, nodejs, parcel
- Language: JavaScript
- Homepage:
- Size: 144 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Import Grapher
Uses Parcel in the background to generate an asset graph
## Install
```
npm install import-grapher
```
## CLI
Generates a `import-graph.json` file in the current working directory.
```bash
importgrapher
```
### Options
- `--no-cache`, disables the caching mechanism
- `--out-file `, sets the output filename
## API
You can also use Import Grapher as a Node.js API
```Javascript
const importGrapher = require('import-grapher');
const path = require('path');
async function getGraph() {
// graph = a JSON Object containing the asset import tree
let graph = await importGrapher(path.join(__dirname, './index.js'));
// do something with the graph...
}
getGraph();
```
## License
MIT