Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anshsinghsonkhia/total-npm-downloads
An NPM Package to track the total package downloads of any NPM package from its launch date to today's date. <We Welcome Contributions for Hacktoberfest 2024>
https://github.com/anshsinghsonkhia/total-npm-downloads
hacktoberfest hacktoberfest-accepted hacktoberfest2024 javascript npm npm-package npmjs statistics
Last synced: 10 days ago
JSON representation
An NPM Package to track the total package downloads of any NPM package from its launch date to today's date. <We Welcome Contributions for Hacktoberfest 2024>
- Host: GitHub
- URL: https://github.com/anshsinghsonkhia/total-npm-downloads
- Owner: AnshSinghSonkhia
- License: apache-2.0
- Created: 2024-02-26T14:28:05.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-08T13:14:34.000Z (11 months ago)
- Last Synced: 2025-01-18T16:18:02.942Z (10 days ago)
- Topics: hacktoberfest, hacktoberfest-accepted, hacktoberfest2024, javascript, npm, npm-package, npmjs, statistics
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/total-npm-downloads
- Size: 1.17 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# total-npm-downloads
Track the total package downloads of any NPM package from its launch date to today's date.
# Installation
```shell
npm i total-npm-downloads
```# Usage
### Replace the `package-name-to-check` to the NPM package name, you want know total downloads of.
```js
import getStats from 'total-npm-downloads';async function getTotalDownloads(packageName) {
try {
const data = await getStats(packageName);
console.log(`Total downloads of "${packageName}" package:`, data.downloads);
} catch (error) {
console.log('Error:', error);
}
}const packageName = 'package-name-to-check';
getTotalDownloads(packageName);
```### Example usage:
```js
import getStats from 'total-npm-downloads';async function getTotalDownloads(packageName) {
try {
const data = await getStats(packageName);
console.log(`Total downloads of "${packageName}" package:`, data.downloads);
} catch (error) {
console.log('Error:', error);
}
}const packageName = 'uuid';
getTotalDownloads(packageName);console.log(getTotalDownloads(packageName));
```