npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

npcheck

v1.0.1

Published

A tool to run various checks on npm modules

Downloads

43

Readme

NPCheck

"Node Package Checker" - A tool to run various checks on npm modules

Node.js CI Coverage Status

Prerequisites

  • Node.js - version 16.x or greater

Install

To install globally: npm i -g npcheck

Configuration

Npcheck requires a configuration file where custom behavior can be specified. The configuration file have to be named npcheck.json in order for npcheck to pick it up.

Options

  • modules: The list of specified modules that npcheck will run checks on. (type: Array)

  • [module].name: The name of the npm module. (type: String)

  • [module].npmLink: Module's NPM url/link (type: String)

  • licenses: Config object to define custom license check behavior. (type: Object)

  • licenses.allow: List that defines global allowed licenses. (type: Array)

  • licenses.rules: Custom per module rules about license checks. (type: Object)

  • licenses.rules[module].allow: Allowed licenses only for the specified module. (type: Array)

  • licenses.rules[modules].override: List of licenses that the cli will treat as warnings (future license decisions to be made) but won't break the CI. (type: Array)

  • citgm.skip[modules]: Modules to be skipped by the CITGM checker (type: Array)

  • allow: Config object do define vulnerabilities that have been accessed as ok to ignore. (type: Object)

  • allow[CVE]: Module and effected modules that are allowed to be ignored for CVE. (type: Array)

  • 'allow[CVE][i].name`: Name of the module against which the CVE is reported. (type: String)

  • 'allow[CVE][i].effects: Modules that include the module againts which the CVE is reported. (type: Array)

Example

A simple npcheck configuration file.

{
  "modules": [
    {
      "name": "express",
      "npmLink": "https://www.npmjs.com/package/express"
    }
  ],
  "licenses": {
    "allow": ["MIT", "Apache-2.0"],
    "rules": {}
  },
  "citgm": {
    "skip": ["rhea"]
  },
  "audit": {
    "allow": {
      "CVE-2022-0235": [{
        "name": "node-fetch",
        "effects": ["opencollective"]
      }]
    }
  }
}

Advanced Options

While npcheck is very opinionated about how it works there is also some extra options you can use to change it's behavior.

version

Outputs the current version of npcheck.

github-token

GitHub's OAuth token npcheck will use when contacting the GitHub API.

no-errors

Treats all errors as warnings.

help

Shows the below help.

Usage: npcheck [options]

Options:
  --help                Show help                                      [boolean]
  --version             Show version number                            [boolean]
  --github-token        Custom GitHub token provided to the API for resources
                        (env variable GITHUB_TOKEN is also an option)
                                                            [string] [default: null]
  --no-errors           Treats every error as a warning     [boolean] [default: false]