https://github.com/bcherny/npm-packages
Fetch a user's package count from NPM
https://github.com/bcherny/npm-packages
Last synced: 8 months ago
JSON representation
Fetch a user's package count from NPM
- Host: GitHub
- URL: https://github.com/bcherny/npm-packages
- Owner: bcherny
- License: mit
- Created: 2013-11-17T04:00:22.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-17T05:19:55.000Z (almost 12 years ago)
- Last Synced: 2024-12-17T03:03:25.314Z (10 months ago)
- Language: CoffeeScript
- Size: 113 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
npm-packages
====================[](https://travis-ci.org/eighttrackmind/npm-packages.png)
Fetch a user's package count from NPM## Usage
```coffee
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](https://npmjs.org/package/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