
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
npm-stats-info
Advanced tools
This is an npm package to interact with the npm api and npm registry. You can search for npm packages, get details, statistics or downlaod counts of any npm package.
This is an npm package to interact with the npm api and npm registry. You can search for npm packages, get details, statistics or downlaod counts of any npm package.
If you have trouble with this package, feel free to ask me in my Discord.
Simply execute the following command in your commandline:
npm install npm-stats-info
First, import the package like this:s
const npmStats = require("npm-stats-info");
To get details about a certain package, you can use the following function:
let package = await npmStats.packageInfo("example-package");
console.log(package)
To get download statistics for a certain package, you can use the following function:
// Get download statistics for "example-package"
let downloads = await npmStats.packageDownloads("example-package");
console.log(downloads)
// Get download statistics for "example-package" from 2023-12-01 until 2022-12-01 (Default is now to one year ago)
// !!! When using a custom time span, "yesterday", "thisMonth" and "lastMonth" might be undefined!
let downloads = await npmStats.packageDownloads("splatoon3api", "2023-12-01", "2022-12-01")
console.log(downloads)
To get download statistics for all packages together on npm, you can use the following function:
let downloads = await npmStats.allDownloads();
console.log(downloads)
To find packages by a string, you can use the following function.
Special search qualifiers can be provided in the full-text query:
author:bcoe
: Show/filter results in which bcoe is the authormaintainer:bcoe
: Show/filter results in which bcoe is qualifier as a maintainerkeywords:batman
: Show/filter results that have batman in the keywords
,
acts like a logical OR+
acts like a logical AND,-
can be used to exclude keywordsnot:unstable
: Exclude packages whose version is < 1.0.0not:insecure
: Exclude packages that are insecure or have vulnerable dependencies (based on the nsp registry)is:unstable
: Show/filter packages whose version is < 1.0.0is:insecure
: Show/filter packages that are insecure or have vulnerable dependencies (based on the nsp registry)boost-exact:false
: Do not boost exact matches, defaults to true// Search for "electron",
// Maximum of 20 results,
// Page 5 (4 * 20 results get skipped)
let result = await npmStats.searchPackage("electron", 20, 4 * 20);
console.log(result)// Output the result
// Search for packages by "kartoffelchips", that has the keywords "splatoon" and "splatoon3"
let myPackages = await npmStats.searchPackage("author:kartoffelchips keywords:splatoon+splatoon3");
console.log(myPackages)// Output the result
GNU General Public License v3.0
You can find the Changelog in CHANGELOG.md.
1.0.3 - 2024-01-05
FAQs
This is an npm package to interact with the npm api and npm registry. You can search for npm packages, get details, statistics or downlaod counts of any npm package.
The npm package npm-stats-info receives a total of 0 weekly downloads. As such, npm-stats-info popularity was classified as not popular.
We found that npm-stats-info demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.