CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-npm-check-updates

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

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

package-managers.mddocs/

Package Manager Support

Multi-package manager support with pluggable architecture. npm-check-updates provides standardized version resolution across different package managers and registries.

Capabilities

Supported Package Managers

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 scenarios

Usage Examples:

// Use yarn
const result = await ncu({
  packageManager: 'yarn',
  upgrade: true
});

// Use pnpm
const result = await ncu({
  packageManager: 'pnpm',
  upgrade: true
});

Package Manager Interface

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>;
}

NPM Package Manager

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:

  • Full npm registry API support
  • Authentication via .npmrc
  • Scoped package support
  • Private registry support
  • Distribution tag support

Usage Examples:

# CLI usage
ncu --packageManager npm --registry https://registry.npmjs.org

# Programmatic usage
await ncu({
  packageManager: 'npm',
  registry: 'https://npm.company.com'
});

Yarn Package Manager

Support for both Yarn Classic (v1) and Yarn Modern (v2+).

// Yarn-specific options
interface RunOptions {
  registryType?: 'yarn';     // Use yarn registry configuration
}

Features:

  • Yarn workspaces support
  • .yarnrc and .yarnrc.yml configuration
  • Yarn-specific version resolution
  • Private registry support

Usage Examples:

# CLI usage
ncu --packageManager yarn

# Use yarn registry config
ncu --registryType yarn

pnpm Package Manager

pnpm support with workspace and monorepo functionality.

// pnpm-specific features
interface RunOptions {
  registryType?: 'pnpm';     // Use pnpm registry configuration
}

Features:

  • pnpm workspaces support
  • Efficient dependency resolution
  • .pnpmrc configuration support
  • Strict peer dependency handling

Usage Examples:

# CLI usage with pnpm
ncu --packageManager pnpm

# Auto-detection via pnpm-lock.yaml
ncu --upgrade

Deno Package Manager

Support for Deno runtime with npm dependencies.

// Deno-specific behavior
interface RunOptions {
  packageManager: 'deno';
}

Features:

  • Deno npm compatibility layer
  • No install command (uses deno cache)
  • ESM-first approach
  • TypeScript built-in support

Usage Examples:

# Deno usage
ncu --packageManager deno --upgrade

Bun Package Manager

Support for Bun runtime and package manager.

// Bun-specific configuration
interface RunOptions {
  packageManager: 'bun';
}

Features:

  • Fast package resolution
  • npm registry compatibility
  • Built-in TypeScript support
  • Efficient installation

Usage Examples:

# Bun usage
ncu --packageManager bun --upgrade

Static Registry

Offline/cached package manager for static environments.

// Static registry configuration
interface RunOptions {
  packageManager: 'staticRegistry';
}

Features:

  • Offline operation support
  • Cached version data
  • Custom version mappings
  • Testing and CI environments

Usage Examples:

# Static registry mode
ncu --packageManager staticRegistry

Package Manager Detection

Automatic 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:

  1. Check for lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb)
  2. Check packageManager field in package.json
  3. Check for manager-specific config files (.npmrc, .yarnrc, .pnpmrc)
  4. Fall back to npm as default

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
});

Registry Configuration

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
});

Cross-Platform Support

Package manager commands are adjusted for different operating systems.

// Platform-specific command handling
const cmd = packageManager + (
  process.platform === 'win32' && packageManager !== 'bun' 
    ? '.cmd' 
    : ''
);

Platform Adjustments:

  • Windows: Adds .cmd suffix for npm, yarn, pnpm (but not bun)
  • Unix/Linux/macOS: Uses command names directly
  • Environment variable handling for colors and configuration

Usage Examples:

# Cross-platform compatibility is automatic
ncu --upgrade --packageManager yarn
# Uses yarn.cmd on Windows, yarn on Unix systems

Install with Tessl CLI

npx tessl i tessl/npm-npm-check-updates

docs

cli-interface.md

configuration.md

index.md

package-managers.md

programmatic-api.md

types.md

tile.json