package-json

Get the package.json of a package from the npm registry

package-json

Get the package.json of a package from the npm registry

$ npm install --save package-json
var packageJson = require('package-json');
 
packageJson('pageres', 'latest', function (errjson) {
    console.log(json);
    //=> { name: 'pageres', ... } 
});
 
// also works with scoped packages 
packageJson('@company/package', 'latest', function (errjson) {
    console.log(json);
    //=> { name: 'package', ... } 
});

You can optionally specify a version (e.g. 0.1.0) or latest.
If you don't specify a version you'll get the main entry containing all versions.

  • npm-keyword - Get a list of npm packages with a certain keyword

MIT © Sindre Sorhus