npm-check-updates

  • Version 16.14.20
  • Published
  • 7.02 MB
  • 33 dependencies
  • Apache-2.0 license

Install

npm i npm-check-updates
yarn add npm-check-updates
pnpm add npm-check-updates

Overview

Find newer versions of dependencies than what your package.json allows

Index

Functions

function run

run: (
runOptions?: RunOptions,
{ cli }?: { cli?: boolean }
) => Promise<PackageFile | Index<VersionSpec> | void>;
  • Main entry point.

    Returns

    Promise< PackageFile Default returns upgraded package file. | Index --jsonUpgraded returns only upgraded dependencies. | void --global upgrade returns void. >

Interfaces

interface RunOptions

interface RunOptions {}
  • Options that can be given on the CLI or passed to the ncu module to control all behavior.

property cache

cache?: boolean;
  • Cache versions to a local cache file. Default --cacheFile is ~/.ncu-cache.json and default --cacheExpiration is 10 minutes.

property cacheClear

cacheClear?: boolean;
  • Clear the default cache, or the cache file specified by --cacheFile.

property cacheExpiration

cacheExpiration?: number;
  • Cache expiration in minutes. Only works with --cache.

    10

property cacheFile

cacheFile?: string;
  • Filepath for the cache file. Only works with --cache.

    "~/.ncu-cache.json"

property color

color?: boolean;
  • Force color in terminal.

property concurrency

concurrency?: number;
  • Max number of concurrent HTTP requests to registry.

    8

property configFileName

configFileName?: string;
  • Config file name. (default: .ncurc.{json,yml,js,cjs})

property configFilePath

configFilePath?: string;
  • Directory of .ncurc config file. (default: directory of packageFile)

property cwd

cwd?: string;
  • Working directory in which npm will be executed.

property deep

deep?: boolean;
  • Run recursively in current working directory. Alias of (--packageFile '**\/package.json').

property dep

dep?: string | string[];
  • Check one or more sections of dependencies only: dev, optional, peer, prod, or packageManager (comma-delimited).

    ["prod","dev","optional"]

property deprecated

deprecated?: boolean;
  • Include deprecated packages.

property doctor

doctor?: boolean;
  • Iteratively installs upgrades and runs tests to identify breaking upgrades. Requires -u to execute. Run "ncu --help --doctor" for details.

property doctorInstall

doctorInstall?: string;
  • Specifies the install script to use in doctor mode. (default: npm install or the equivalent for your package manager)

property doctorTest

doctorTest?: string;
  • Specifies the test script to use in doctor mode. (default: npm test)

property enginesNode

enginesNode?: boolean;
  • Include only packages that satisfy engines.node as specified in the package file.

property errorLevel

errorLevel?: number;
  • Set the error level. 1: exits with error code 0 if no errors occur. 2: exits with error code 0 if no packages need updating (useful for continuous integration).

    1

property filter

filter?: string | RegExp | (string | RegExp)[] | FilterFunction;
  • Include only package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function. Run "ncu --help --filter" for details.

property filterResults

filterResults?: FilterResultsFunction;
  • Filters out upgrades based on a user provided function. Run "ncu --help --filterResults" for details.

property filterVersion

filterVersion?: string | RegExp | (string | RegExp)[] | FilterFunction;
  • Filter on package version using comma-or-space-delimited list, /regex/, or predicate function. Run "ncu --help --filterVersion" for details.

property format

format?: string[];
  • Modify the output formatting or show additional information. Specify one or more comma-delimited values: group, ownerChanged, repo, time, lines. Run "ncu --help --format" for details.

property global

global?: boolean;
  • Check global packages instead of in the current project.

property groupFunction

groupFunction?: GroupFunction;
  • Customize how packages are divided into groups when using --format group. Run "ncu --help --groupFunction" for details.

property install

install?: 'always' | 'never' | 'prompt';
  • Control the auto-install behavior: always, never, prompt. Run "ncu --help --install" for details.

    "prompt"

property interactive

interactive?: boolean;
  • Enable interactive prompts for each dependency; implies -u unless one of the json options are set.

property jsonAll

jsonAll?: boolean;
  • Output new package file instead of human-readable message.

property jsonDeps

jsonDeps?: boolean;
  • Like jsonAll but only lists dependencies, devDependencies, optionalDependencies, etc of the new package data.

property jsonUpgraded

jsonUpgraded?: boolean;
  • Output upgraded dependencies in json.

property loglevel

loglevel?: string;
  • Amount to log: silent, error, minimal, warn, info, verbose, silly.

    "warn"

property mergeConfig

mergeConfig?: boolean;
  • Merges nested configs with the root config file for --deep or --packageFile options. (default: false)

property minimal

minimal?: boolean;
  • Do not upgrade newer versions that are already satisfied by the version range according to semver.

property packageData

packageData?: string | PackageFile;
  • Package file data (you can also use stdin).

property packageFile

packageFile?: string;
  • Package file(s) location. (default: ./package.json)

property packageManager

packageManager?: 'npm' | 'yarn' | 'pnpm' | 'deno' | 'bun' | 'staticRegistry';
  • npm, yarn, pnpm, deno, bun, staticRegistry (default: npm). Run "ncu --help --packageManager" for details.

property peer

peer?: boolean;
  • Check peer dependencies of installed packages and filter updates to compatible versions. Run "ncu --help --peer" for details.

property pre

pre?: boolean;
  • Include prerelease versions, e.g. -alpha.0, -beta.5, -rc.2. Automatically set to 1 when --target is newest or greatest, or when the current version is a prerelease. (default: 0)

property prefix

prefix?: string;
  • Current working directory of npm.

property registry

registry?: string;
  • Specify the registry to use when looking up package versions.

property registryType

registryType?: 'npm' | 'json';
  • Specify whether --registry refers to a full npm registry or a simple JSON file or url: npm, json. (default: npm) Run "ncu --help --registryType" for details.

property reject

reject?: string | RegExp | (string | RegExp)[] | FilterFunction;
  • Exclude packages matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function. Run "ncu --help --reject" for details.

property rejectVersion

rejectVersion?: string | RegExp | (string | RegExp)[] | FilterFunction;
  • Exclude package.json versions using comma-or-space-delimited list, /regex/, or predicate function. Run "ncu --help --rejectVersion" for details.

property removeRange

removeRange?: boolean;
  • Remove version ranges from the final package version.

property retry

retry?: number;
  • Number of times to retry failed requests for package info.

    3

property root

root?: boolean;
  • Runs updates on the root project in addition to specified workspaces. Only allowed with --workspace or --workspaces. (default: false)

property silent

silent?: boolean;
  • Don't output anything. Alias for --loglevel silent.

property stdin

stdin?: string;
  • Read package.json from stdin.

property target

target?:
| 'latest'
| 'newest'
| 'greatest'
| 'minor'
| 'patch'
| 'semver'
| `@${string}`
| TargetFunction;
  • Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, @[tag], or [function]. (default: latest) Run "ncu --help --target" for details.

property timeout

timeout?: number;
  • Global timeout in milliseconds. (default: no global timeout and 30 seconds per npm-registry-fetch)

property upgrade

upgrade?: boolean;
  • Overwrite package file with upgraded versions instead of just outputting to console.

property verbose

verbose?: boolean;
  • Log additional information for debugging. Alias for --loglevel verbose.

property workspace

workspace?: string[];
  • Run on one or more specified workspaces. Add --root to also upgrade the root project.

property workspaces

workspaces?: boolean;
  • Run on all workspaces. Add --root to also upgrade the root project.

Package Files (2)

Dependencies (33)

Dev Dependencies (52)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/npm-check-updates.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/npm-check-updates)
  • HTML
    <a href="https://www.jsdocs.io/package/npm-check-updates"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>