Socket
Socket
Sign inDemoInstall

npcheck

Package Overview
Dependencies
14
Maintainers
9
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    npcheck

A tool to run various checks on npm modules


Version published
Maintainers
9
Created

Changelog

Source

1.0.1 (2023-07-14)

Bug Fixes

  • upgrade @npmcli/arborist from 6.2.9 to 6.2.10 (#171) (ea76431)

Readme

Source

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]

FAQs

Last updated on 10 Jan 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc