attach package.json contents to a dependency stream

npm install get-package-jsons
1 downloads in the last day
7 downloads in the last week
15 downloads in the last month



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.

npm loves you