1.0.2 • Published 8 years ago

npm-download-count v1.0.2

Weekly downloads
11
License
-
Repository
github
Last release
8 years ago

npm-download-counts

Build Status

Note: the npm download counts are pretty dodgy for a number of reasons, you probably shouldn't pretend they are accurate.

const moment = require('moment')
    , downloadCounts = require('npm-download-count')

    , package_name    = 'levelup'
    , start  = moment().subtract(3, 'days').toDate() // start date for lookup
    , end    = new Date()                              // end date for lookup

downloadCounts({
    package_name,
    time_period: {
        start,
        end,
    },
})
.then(count => {
    console.log('%s was downloaded ~%d times in the last 3 days', package_name, count)
});

downloadCounts({
    package_name,
    time_period: 'last-month',
})
.then(count => {
    console.log('%s was downloaded ~%d times in the last month', package_name, count)
});

Gives you something like:

levelup was downloaded ~122450 times in the last month
levelup was downloaded ~16344 times in the last 3 days
1.0.2

8 years ago

1.0.1

8 years ago

2.0.4

8 years ago