NPM.listPackagesWithDetails()

List matching packages and include metadata from their package.json files.

Also includes the raw package.json string as `rawJson`, in case you need to parse additional non-standard metadata.

Usage

Hover over inputs/exits for more info.

var NPM = require('machinepack-npm');


// List matching packages and include metadata from their package.json files.

NPM.listPackagesWithDetails({

query: 'sails',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

query required

The search query to send to NPM.

'sails'

Exits

error

An unexpected error occurred.

success

OK.

[ { name: 'browserify',
    description: 'asg',
    version: '0.1.1',
    latestVersionPublishedAt: '2015-01-19T22:26:54.588Z',
    npmUrl: 'http://npmjs.org/package/machinepack-foo',
    sourceUrl: 'https://github.com/baz/machinepack-foo',
    author: 'Substack <substack@substack.com>',
    main: 'lib/index.js',
    license: 'MIT',
    rawJson: '{...package.json data as a JSON string...}',
    keywords: [ 'machine' ],
    contributors: [ { name: 'Substack', email: 'substack@substack.com' } ],
    dependencies: [ { name: 'lodash', semverRange: '^2.4.1' } ] } ]