https://github.com/rcasto/downpop
Just a simple way to get a glance at raw download counts for npm packages.
https://github.com/rcasto/downpop
download-data npm npm-cli npm-package-info npx
Last synced: 3 months ago
JSON representation
Just a simple way to get a glance at raw download counts for npm packages.
- Host: GitHub
- URL: https://github.com/rcasto/downpop
- Owner: rcasto
- License: mit
- Created: 2020-07-02T02:39:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T13:56:39.000Z (almost 3 years ago)
- Last Synced: 2025-02-20T12:47:52.989Z (4 months ago)
- Topics: download-data, npm, npm-cli, npm-package-info, npx
- Language: JavaScript
- Homepage:
- Size: 2.73 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# downpop
Just a simple way to get a glance at raw download counts for npm packages.
## Usage
### Via npx
```
npx downpop ...
```To make sure you are using the latest version you can also do:
```
npx downpop@latest ...
```### Via code
1. Install the package using npm or otherwise:
```
npm install downpop
```
2. Import and use in your code:
```javascript
import { buildNpmPackageInfoCharts } from 'downpop';buildNpmPackageInfoCharts([
'jquery',
'react',
'vue'
])
.then(packageInfoChartsResult => console.log(packageInfoChartsResult.charts['last-month']));
```### Examples
- [Browser](https://codepen.io/rcasto/pen/LYGQbPy)## API
```javascript
/**
* @typedef {Object} NpmPackageInfo
* @property {string} package
* @property {number} downloads
* @property {string} start
* @property {string} end
*//**
* @typedef {Object} PackageInfo
* @property {NpmPackageInfo[]} last-day
* @property {NpmPackageInfo[]} last-week
* @property {NpmPackageInfo[]} last-month
* @property {NpmPackageInfo[]} last-year
*//**
* @param {string|string[]} packageNames
* @returns {Promise}
*/
function getNpmPackageInfo(packageNames) {...}/**
* @typedef {Object} PackageInfoCharts
* @property {string} last-day
* @property {string} last-week
* @property {string} last-month
* @property {string} last-year
*//**
* @typedef {Object} PackageInfoChartsResult
* @property {PackageInfoCharts} charts
* @property {string} error
*//**
* @param {string|string[]} packageNames
* @returns {Promise}
*/
function buildNpmPackageInfoCharts(packageNames) {...}
```## Notes
- If you have [Node.js](https://nodejs.org) installed, you will in turn have [npm](https://www.npmjs.com/get-npm) installed and thus [npx](https://github.com/npm/npx) should be available for you to use as well.## Resources
- [npm registry download counts api documentation](https://github.com/npm/registry/blob/master/docs/download-counts.md)
- [npx: an npm package runner](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b)