Find newer versions of dependencies than what your package.json allows
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Multi-package manager support with pluggable architecture. npm-check-updates provides standardized version resolution across different package managers and registries.
npm-check-updates supports multiple package managers with consistent API.
type PackageManagerName = 'npm' | 'yarn' | 'pnpm' | 'deno' | 'bun' | 'staticRegistry';
interface RunOptions {
packageManager?: PackageManagerName;
}Supported Managers:
'npm' - Default npm package manager'yarn' - Yarn package manager (v1 and v2+)'pnpm' - pnpm package manager'deno' - Deno runtime with npm dependencies'bun' - Bun runtime and package manager'staticRegistry' - Static registry for offline/cached scenariosUsage Examples:
// Use yarn
const result = await ncu({
packageManager: 'yarn',
upgrade: true
});
// Use pnpm
const result = await ncu({
packageManager: 'pnpm',
upgrade: true
});Standardized interface that all package managers implement for version resolution.
interface PackageManager {
/**
* Get the latest stable version
*/
latest(
packageName: string,
currentVersion: VersionSpec,
options: Options
): Promise<VersionSpec | null>;
/**
* Get the newest version including prereleases
*/
newest(
packageName: string,
currentVersion: VersionSpec,
options: Options
): Promise<VersionSpec | null>;
/**
* Greatest version ignoring prerelease suffix
*/
greatest(
packageName: string,
currentVersion: VersionSpec,
options: Options
): Promise<VersionSpec | null>;
/**
* Latest minor version within same major
*/
minor(
packageName: string,
currentVersion: VersionSpec,
options: Options
): Promise<VersionSpec | null>;
/**
* Latest patch version within same minor
*/
patch(
packageName: string,
currentVersion: VersionSpec,
options: Options
): Promise<VersionSpec | null>;
/**
* Latest version within semver range
*/
semver(
packageName: string,
currentVersion: VersionSpec,
options: Options
): Promise<VersionSpec | null>;
/**
* Get version for specific distribution tag
*/
distTag(
packageName: string,
tag: string,
options: Options
): Promise<VersionSpec | null>;
}Default package manager with full npm registry support.
// NPM-specific configuration
interface RunOptions {
registry?: string; // Custom npm registry URL
registryType?: 'npm'; // Explicit npm registry type
}Features:
.npmrcUsage Examples:
# CLI usage
ncu --packageManager npm --registry https://registry.npmjs.org
# Programmatic usage
await ncu({
packageManager: 'npm',
registry: 'https://npm.company.com'
});Support for both Yarn Classic (v1) and Yarn Modern (v2+).
// Yarn-specific options
interface RunOptions {
registryType?: 'yarn'; // Use yarn registry configuration
}Features:
.yarnrc and .yarnrc.yml configurationUsage Examples:
# CLI usage
ncu --packageManager yarn
# Use yarn registry config
ncu --registryType yarnpnpm support with workspace and monorepo functionality.
// pnpm-specific features
interface RunOptions {
registryType?: 'pnpm'; // Use pnpm registry configuration
}Features:
.pnpmrc configuration supportUsage Examples:
# CLI usage with pnpm
ncu --packageManager pnpm
# Auto-detection via pnpm-lock.yaml
ncu --upgradeSupport for Deno runtime with npm dependencies.
// Deno-specific behavior
interface RunOptions {
packageManager: 'deno';
}Features:
Usage Examples:
# Deno usage
ncu --packageManager deno --upgradeSupport for Bun runtime and package manager.
// Bun-specific configuration
interface RunOptions {
packageManager: 'bun';
}Features:
Usage Examples:
# Bun usage
ncu --packageManager bun --upgradeOffline/cached package manager for static environments.
// Static registry configuration
interface RunOptions {
packageManager: 'staticRegistry';
}Features:
Usage Examples:
# Static registry mode
ncu --packageManager staticRegistryAutomatic package manager detection based on lock files and configuration.
/**
* Determine appropriate package manager based on project files
* @param options - Configuration options
* @returns Detected package manager name
*/
function determinePackageManager(options: Options): PackageManagerName;Detection Logic:
package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb)packageManager field in package.json.npmrc, .yarnrc, .pnpmrc)Usage Examples:
// Automatic detection
const result = await ncu({
upgrade: true
// packageManager will be auto-detected
});
// Override detection
const result = await ncu({
upgrade: true,
packageManager: 'yarn' // Force yarn usage
});Configure custom registries and authentication for different package managers.
interface RunOptions {
registry?: string; // Custom registry URL
registryType?: 'npm' | 'yarn' | 'pnpm'; // Registry configuration source
}Usage Examples:
// Private npm registry
await ncu({
packageManager: 'npm',
registry: 'https://npm.company.com',
upgrade: true
});
// Use yarn registry configuration
await ncu({
packageManager: 'npm',
registryType: 'yarn', // Read registry from .yarnrc
upgrade: true
});Package manager commands are adjusted for different operating systems.
// Platform-specific command handling
const cmd = packageManager + (
process.platform === 'win32' && packageManager !== 'bun'
? '.cmd'
: ''
);Platform Adjustments:
.cmd suffix for npm, yarn, pnpm (but not bun)Usage Examples:
# Cross-platform compatibility is automatic
ncu --upgrade --packageManager yarn
# Uses yarn.cmd on Windows, yarn on Unix systemsInstall with Tessl CLI
npx tessl i tessl/npm-npm-check-updates