node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


attach package.json contents to a dependency stream


var getPackageJsons = require('get-package-jsons');
var packageGetter = getPackageJsons({registry: ''}); // optional 
var dependency = {
  name: 'request',
  version: '2.3.10' // requires an *exact* version. 
packageGetter.get(dependency, function (err) {
  console.log(dependency['package']); // => parsed package.json content 
// Or use as a through stream 
var createDependencyStream = require('create-dependency-stream');
var resolveDependencyVersions = require('resolve-dependency-versions');
var dependencies = createDependencyStream('/path/to/package.json');

Attaches package.json contents from a remote registry to dependency objects. Note that the dependency object must have an exact version, not a version range. See resolve-package-dependencies for a module that does that.