🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

npm-stats-info

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-stats-info

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.

1.0.3
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

npm-Stats-info

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.

npm-downloads NPM-Version Discord

If you have trouble with this package, feel free to ask me in my Discord.

Table of contents

Installation

Simply execute the following command in your commandline:

npm install npm-stats-info

Usage

First, import the package like this:s

const npmStats = require("npm-stats-info");

Package details

To get details about a certain package, you can use the following function:

let package = await npmStats.packageInfo("example-package");
console.log(package)

Package downloads

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)

All 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)

Find packages

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 author
  • maintainer:bcoe: Show/filter results in which bcoe is qualifier as a maintainer
  • keywords:batman: Show/filter results that have batman in the keywords
    • separating multiple keywords with
      • , acts like a logical OR
      • + acts like a logical AND
      • ,- can be used to exclude keywords
  • not:unstable: Exclude packages whose version is < 1.0.0
  • not: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.0
  • is: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

LICENSE

GNU General Public License v3.0

Changelog

You can find the Changelog in CHANGELOG.md.

Keywords

npm

FAQs

Package last updated on 05 Jan 2024

Did you know?

Socket

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.

Install

Related posts