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
Comprehensive configuration system supporting both programmatic and CLI usage. The RunOptions interface controls all aspects of dependency checking and upgrading behavior.
Main configuration interface for all npm-check-updates operations.
interface RunOptions {
// Core options
upgrade?: boolean;
packageFile?: string;
packageManager?: 'npm' | 'yarn' | 'pnpm' | 'deno' | 'bun' | 'staticRegistry';
cwd?: string;
global?: boolean;
// Version targeting
target?: 'latest' | 'newest' | 'greatest' | 'minor' | 'patch' | 'semver' | `@${string}` | TargetFunction;
peer?: boolean;
dep?: string | readonly string[];
// Filtering
filter?: string | RegExp | readonly (string | RegExp)[] | FilterFunction;
reject?: string | RegExp | readonly (string | RegExp)[] | FilterFunction;
filterVersion?: string | RegExp | readonly (string | RegExp)[] | FilterResultsFunction;
// Output and interaction
interactive?: boolean;
format?: readonly string[];
json?: boolean;
jsonUpgraded?: boolean;
loglevel?: 'silent' | 'error' | 'minimal' | 'warn' | 'info' | 'verbose' | 'silly';
color?: boolean;
// Advanced features
doctor?: boolean;
deep?: boolean;
workspaces?: boolean;
workspace?: readonly string[];
timeout?: string | number;
// Caching
cache?: boolean;
cacheFile?: string;
cacheClear?: boolean;
// Installation
install?: 'always' | 'never' | 'prompt';
// Registry and authentication
registry?: string;
registryType?: 'npm' | 'yarn' | 'pnpm';
// Error handling
errorLevel?: 1 | 2;
retry?: number;
// Configuration
configFileName?: string;
configFilePath?: string;
mergeConfig?: boolean;
}Control which versions to upgrade to with fine-grained targeting strategies.
type TargetString = 'latest' | 'newest' | 'greatest' | 'minor' | 'patch' | 'semver';
type TargetDistTag = `@${string}`;
type Target = TargetString | TargetDistTag | TargetFunction;
interface RunOptions {
target?: Target;
peer?: boolean;
dep?: string | readonly string[];
}Target Options:
'latest' - Latest stable version'newest' - Newest version including prereleases'greatest' - Greatest version ignoring prerelease suffix'minor' - Latest minor version within same major'patch' - Latest patch version within same minor'semver' - Latest version within semver range'@tag' - Specific npm distribution tag (e.g., @beta, @next)Usage Examples:
// Minor updates only
const options: RunOptions = {
target: 'minor',
upgrade: true
};
// Beta versions
const options: RunOptions = {
target: '@beta',
upgrade: true
};
// Custom target function
const options: RunOptions = {
target: (packageName, versions) => {
// Custom logic for version selection
return versions[0]; // Return first available version
}
};Advanced filtering options for selective package upgrades.
type FilterFunction = (packageName: string, versionRange: SemVer[]) => boolean;
type FilterResultsFunction = (
packageName: string,
versioningMetadata: {
current: string;
available: string;
// ... additional metadata
}
) => boolean;
interface RunOptions {
filter?: string | RegExp | readonly (string | RegExp)[] | FilterFunction;
reject?: string | RegExp | readonly (string | RegExp)[] | FilterFunction;
filterVersion?: string | RegExp | readonly (string | RegExp)[] | FilterResultsFunction;
}Usage Examples:
// String patterns
const options: RunOptions = {
filter: 'react*',
reject: 'eslint*'
};
// Regex patterns
const options: RunOptions = {
filter: /^@myorg\//,
reject: /@types\//
};
// Multiple patterns
const options: RunOptions = {
filter: ['react*', '@angular/*', /^lodash/]
};
// Custom filter function
const options: RunOptions = {
filter: (packageName, versions) => {
return packageName.startsWith('@company/');
}
};Control output format, logging, and information display.
interface RunOptions {
format?: readonly string[];
json?: boolean;
jsonUpgraded?: boolean;
loglevel?: 'silent' | 'error' | 'minimal' | 'warn' | 'info' | 'verbose' | 'silly';
color?: boolean;
}Format Options:
'table' - Default table format'group' - Group by upgrade type (major, minor, patch)'ownerChanged' - Show ownership changes'repo' - Show repository information'time' - Show publish time information'lines' - Line-by-line formatUsage Examples:
// Grouped output with repository info
const options: RunOptions = {
format: ['group', 'repo'],
color: true
};
// JSON output only
const options: RunOptions = {
json: true,
loglevel: 'silent'
};
// Verbose logging
const options: RunOptions = {
loglevel: 'verbose'
};Configuration for specialized functionality and complex scenarios.
interface RunOptions {
doctor?: boolean;
deep?: boolean;
workspaces?: boolean;
workspace?: readonly string[];
timeout?: string | number;
interactive?: boolean;
}Usage Examples:
// Doctor mode with timeout
const options: RunOptions = {
doctor: true,
upgrade: true,
timeout: 300000 // 5 minutes
};
// Workspace configuration
const options: RunOptions = {
workspaces: true, // Check all workspaces
deep: true
};
// Specific workspaces
const options: RunOptions = {
workspace: ['packages/core', 'packages/ui']
};
// Interactive mode
const options: RunOptions = {
interactive: true,
upgrade: true
};Performance optimization through version caching.
interface RunOptions {
cache?: boolean;
cacheFile?: string;
cacheClear?: boolean;
}Usage Examples:
// Enable caching with default file
const options: RunOptions = {
cache: true
};
// Custom cache file
const options: RunOptions = {
cache: true,
cacheFile: '~/.ncu-cache-project.json'
};
// Clear cache before running
const options: RunOptions = {
cacheClear: true,
cache: true
};Configure package registry and authentication settings.
interface RunOptions {
registry?: string;
registryType?: 'npm' | 'yarn' | 'pnpm';
}Usage Examples:
// Private registry
const options: RunOptions = {
registry: 'https://npm.company.com'
};
// Use yarn registry configuration
const options: RunOptions = {
registryType: 'yarn'
};Control error reporting and exit behavior.
interface RunOptions {
errorLevel?: 1 | 2;
retry?: number;
}Usage Examples:
// Exit with error if upgrades available
const options: RunOptions = {
errorLevel: 2
};
// Retry failed network requests
const options: RunOptions = {
retry: 3
};Support for external configuration files and merging strategies.
interface RunOptions {
configFileName?: string;
configFilePath?: string;
mergeConfig?: boolean;
}Usage Examples:
// Custom config file name
const options: RunOptions = {
configFileName: '.ncu-project'
};
// Specific config path
const options: RunOptions = {
configFilePath: '/path/to/ncu-config.json'
};
// Merge with CLI options
const options: RunOptions = {
mergeConfig: true,
target: 'minor' // Override config file setting
};Install with Tessl CLI
npx tessl i tessl/npm-npm-check-updates