resolve npm dependency trees

npm install npmd-resolve
2 downloads in the last day
91 downloads in the last week
181 downloads in the last month


npmd dependency tree resolution.

given an npmd database full of npm package.jsons, resolve the dependency tree for a module & version.

If a leveldb is not provided, npmd-resolve will resolve by looking in your ~/.npm/ cache, or querying the npm registry, if you provide the {online: true} option.


var resolve = require('npmd-resolve')
//versionSublevel, moduleName, moduleVersion, config
resolve(db.sublevel('ver'), 'browserify', '2', 
  {greedy: true}, function (err, tree) {


npm install -g npmd-resolve npmd-install
# then
npmd-resolve browserify | npmd-install
# or
npmd-resolve browserify --online | npmd-install


npmd-resolve module@ver,...   # resolve specific modules
npmd-resolve < package.json   # resolve all deps for this package.json
npmd-resolve                  # resolve all deps for current directory

data format:

npmd-resolve assumes a leveldb of package.json's with format: + '!' + paddedSemver(package.version) : package

padded semver converts semver into strings that are bytewise sorted.

greedy mode

If {greedy: true} is enabled, resolve will build a dependency tree that is deduplicated by default.



npm loves you