Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Risto-Stevcev/bs-dependency-graph

Repository files navigation

bs-dependency-graph

Build Status Latest release License

Generates the module dependency graph for a bucklescript project

Usage

Install it for your bucklescript project:

$ npm install --save-dev bs-dependency-graph

Optionally, you can use json-to-dot to convert it to the dot format:

$ npm install --save-dev json-to-dot

And if you have graphviz installed, you can convert the dot format to an image using the dot command, and then preview it with ImageMagick.

Combining these together, you can add it as a command in your package.json:

{
  "name": "bs-some-project",
  ...

  "scripts": {
    "graph:dot": "bs-dependency-graph | json-to-dot > graph.dot",
    "graph:image": "dot -Tpng graph.dot -o graph.png",
    "graph:view": "display graph.png",
    "graph": "npm run graph:dot && npm run graph:image"
  },
  ...
}

How it Works

The library fetches all of your project files based on the settings in bsconfig.json and then runs ocamldep on the files to get the dependency graph

License

See LICENSE

About

Generates a dependency graph for a bucklescript project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages