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

https://github.com/hchiam/deps

Create a dependency graph visual, starting from a folder or file.
https://github.com/hchiam/deps

dependecy files folders graph js ts visualization

Last synced: 3 months ago
JSON representation

Create a dependency graph visual, starting from a folder or file.

Awesome Lists containing this project

README

        

# `@hchiam/deps` [![version](https://img.shields.io/npm/v/@hchiam/deps.svg?style=flat-square)](https://www.npmjs.com/package/@hchiam/deps) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/hchiam/deps/blob/master/LICENSE)

## Example usage:

This:

was generated by this: (after you install [`@hchiam/deps`](https://www.npmjs.com/package/@hchiam/deps), not [`deps`](https://www.npmjs.com/package/deps))

```bash
deps
Enter max depth:
Enter src folder (or file or other folder you'd like to inspect): src
```

This interactive CLI tool `deps` generates a [dependency graph](https://en.wikipedia.org/wiki/Dependency_graph) of your files. You just have to give it a file or folder as a starting point. You can (optionally) tell it how deep to explore. It's basically a convenient but limited wrapper around [`depcruise`](https://www.npmjs.com/package/dependency-cruiser), which gives you an interactive SVG (clicking on nodes shows you code from local files).

## Install:

```bash
npm -g install @hchiam/deps
```

Now you can use it in any folder with this command:

```bash
deps
```

## Further development

Commands I found useful while creating the npm package for this CLI tool from scratch:

- `npm link`
- `rm /Users/howard/.nvm/versions/node/v10.13.0/bin/deps`
- `npm publish --access public`

A newer example of how to publish to npm (package.json setup only + `yarn publish`):
- https://github.com/hchiam/trysterollup/tree/24457690a715e1c57e701b0d51e3b6fd3e50491c
- https://github.com/hchiam/trysterollup/blob/24457690a715e1c57e701b0d51e3b6fd3e50491c/package.json