Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    npm-download-countspublic

    This package has been deprecated

    Author message:

    no longer maintained

    npm-download-counts

    Fetch package download counts for packages from the npm registry

    Build Status

    NPM

    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  = moment().subtract('months', 1).toDate() // start date for lookup 
        , end    = new Date()                              // end date for lookup 
     
    downloadCounts(
        pkg
      , start
      , end
      , function (err, data) {
          // `data` is an array of objects with `day` and `count` properties 
          // each element of the array represents a day in your date range 
          data.forEach(function (d, i) {
            console.log('On %s, %s was downloaded ~%d times', d.day, pkg, d.count)
          })
        }
    )

    Gives you something like:

    On 2013-06-15, levelup was downloaded ~91 times
    On 2013-06-16, levelup was downloaded ~47 times
    On 2013-06-17, levelup was downloaded ~57 times
    On 2013-06-18, levelup was downloaded ~141 times
    ...

    Collaborators

    • Rod Vagg [@rvagg] (https://github.com/rvagg)
    • Dav Glass @davglass

    Licence & copyright

    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.

    Keywords

    none

    install

    npm i npm-download-counts

    Downloadslast 7 days

    6

    version

    0.1.2

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar