An open API service indexing awesome lists of open source software.

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

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