Required children tree.
npm install -g require-list
rlist [javascript file path in entry-point]
/tmp/a.js
var b = require('./b');
var test = require('./test');
/tmp/b.js
require('./test/c');
module.exports = 'b';
/tmp/test/index.js
require('./c');
/tmp/test/c.js
module.exports = function() { return 'c' };
$ rlist /tmp/a.js
/tmp/a.js
├── b.js
| └── test/c.js
└── test/index.js
└── test/c.js
var rlist = require('require-list');
console.log('rlist(filepath)');
console.log(rlist('/tmp/a.js'));
console.log('rlist.string(filepath)');
console.log(rlist.string('/tmp/a.js'));
// --output--
// rlist(filepath)
// { '/tmp/b.js': { '/tmp/test/c.js': {} },
// '/tmp/test/index.js': { '/tmp/test/c.js': {} } } }
// rlist.string(filepath)
// /tmp/a.js
// ├── b.js
// | └── test/c.js
// └── test/index.js
// └── test/c.js
- Fork it ( https://github.com/iyu/require-list/fork )
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
npm test; npm run jshint
command and confirm that it passes - Create new Pull Request