@debitoor/parse-dependencies
v1.0.1
Published
finding node code dependencies
Downloads
69
Maintainers
Readme
parse-dependencies
Fast and easy way to get dependencies for your code.
Install
npm i -SE @debitoor/parse-dependencies
Usage
const parse = require('@debitoor/parse-dependencies');
parse(__dirname + '/server.js', function (err, deps) {
console.log(deps); // 'express', 'body-parser' ...
});
You can compare result with you production dependencies
const parse = require('@debitoor/parse-dependencies');
const packageDeps = require('./package').dependencies;
parse(__dirname + '/server.js', function (err, deps) {
const diff = deps.filter(function (item) {
return !(item in packageDeps);
});
if (diff.length) {
console.log('oops. You have missing depencies\n%s', diff.join());
}
});