npm package download counts for date ranges
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-counts'pkg = 'levelup'start = momentsubtract'months' 1toDate // start date for lookupend = // end date for lookupdownloadCountspkgstartend// `data` is an array of objects with `day` and `count` properties// each element of the array represents a day in your date rangedataforEachconsole.log'On %s, %s was downloaded ~%d times' dday pkg dcount
Gives you something like:
On 2013-06-15, levelup was downloaded ~91 timesOn 2013-06-16, levelup was downloaded ~47 timesOn 2013-06-17, levelup was downloaded ~57 timesOn 2013-06-18, levelup was downloaded ~141 times...
Copyright (c) 2014 Rod Vagg and Contributors (above)
npm-download-counts is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.