NpmStat.getStats()

Fetch download stats for the specified NPM package and date range.

Usage

Hover over inputs/exits for more info.

var NpmStat = require('machinepack-npmstat');


// Fetch download stats for the specified NPM package and date range.

NpmStat.getStats({

packageName: 'machinepack-util',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

packageName required

The name of the NPM package.

'machinepack-util'

Exits

error

An unexpected error occurred.

success

OK.

{ perDay: [ { day: '2015-04-11', downloads: 29 } ],
  total: 11712 }