Print a graph of local Node.js module dependencies
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
find-requires

README.md

find-requires

Searches a Node.js project for "local" module includes (i.e. calls to require() with a relative path), and prints file-dependency pairs to stdout.

The output can be used by tsort(1) to locate circular dependencies.

Example

a.js:

var foo = require('foo')
var b = require('./b')
var c = require('./c')
// ...

b.js:

var bar = require('bar')
var c = require('./c')
// ...

c.js:

var baz = require('baz')
// ...

Output of find-requires /path/to/project:

a.js b.js
a.js c.js
b.js c.js

References