Contributing

Contributions to npm-check-updates are happily accepted. This guide will help you get started.

Filing an Issue

Before filing an issue, please:

  1. Read the list of Known Issues.
  2. Search for similar issues to avoid duplicates.

When filing a bug report, please include:

  • Node.js version
  • npm version
  • npm-check-updates version
  • The relevant package names and their specified versions from your package.json.
  • For global mode issues, the output from npm -g ls --depth=0.

Development Setup

  1. Clone the repository:

    git clone https://github.com/raineorshine/npm-check-updates.git
    cd npm-check-updates

  2. Install dependencies: This project uses npm for dependency management.

    npm ci

  3. Install Git Hooks: The project includes pre-push git hooks to run linting and formatting checks. Install them by running:

    npm run prepare

Running Tests

Run the full test suite, which includes unit and end-to-end tests:

npm run test

To run only unit tests:

npm run test:unit

Linting and Formatting

To check for linting errors, run:

npm run lint

To automatically fix formatting issues, use Prettier:

npm run prettier:fix

Building the Project

To compile the TypeScript source code, run:

npm run build

This will generate the distributable files in the build/ directory.

Known Issues

  • If ncu prints output that does not seem related to this package, it may be conflicting with another executable such as ncu-weather-cli or Nvidia CUDA. Try using the long name instead: npm-check-updates.
  • Windows: If npm-check-updates hangs, try setting the package file explicitly: ncu --packageFile package.json. You can run ncu --loglevel verbose to confirm that it was incorrectly waiting for stdin.