Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetch a user's package count from NPM
CoffeeScript
branch: master
Failed to load latest commit information.
test tests - passing
.gitignore initial
.travis.yml add travis
LICENSE.md add license, readme
README.md update docs
npm-packages.coffee add tests
npm-packages.js add tests
package.json build passed -> v bump

README.md

npm-packages

Build Status Fetch a user's package count from NPM

Usage

getPackages = require 'npm-packages'

success = (count) -> ...
error = (err) -> ...
progress = (countSoFar) -> ...

getPackages 'someUserName', success, error, progress

Features

  • Uses promises
  • Supports paginated responses
  • Supports progress for paginated responses

Implementation notes

  • Uses scraping (:[) because NPM has no API and the npm-stats package is inconsistent and times out.
  • Because of the scraping approach, we cannot differentiate between user that exist but have no repos, and users that don't exist. Either will return a rejected promise.

Supported environments

  • Node
  • CommonJS
Something went wrong with that request. Please try again.