Code Monkey home page Code Monkey logo

npcheck's Introduction

NPCheck

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

Node.js CI Coverage Status

Prerequisites

  • Node.js - version 14.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)

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"]
  }
}

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]

npcheck's People

Contributors

aalykiot avatar danbev avatar github-actions[bot] avatar helio-frota avatar lholmquist avatar mhdawson avatar richardlau avatar snyk-bot avatar zubinbhasin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.