1.1.1 • Published 9 years ago
accidentally-cyclic v1.1.1
Accidentally Cyclic (AC)
A CLI tool for creating internal dependency graphs of Node.js projects.
Requirements
- Node.js with ES6 support (tested with Node 6)
- A modern web browser (tested with Firefox and Chrome)
Quick Start
To create the dependency graph for a given project, try:
$ npm install -g accidentally-cyclic
$ cyclic --html graph.html path/to/project/indexThen open graph.html (which will be in the current directory in the above example).
To use AC inside of a project, try:
$ npm install --save accidentally-cyclicThen use cyclic.require on the root of the project.
const cyclic = require('accidentally-cyclic')
// This behaves exactly like a regular `require` does.
const dependencies = cyclic.require('./index')
for (let dependency of dependencies) {
console.log(`${dependency.parent} depends on ${dependency.module}`)
}Known Limitations
We currently don't support recording delayed requires. For example, if a module is required in a callback or promise, it won't get recorded.
// This will not get recorded by AC.
setTimeout(() => {
require('./db')
}, 0)