API Reference NPM v#0.7.1

Copy Markdown View Source

Modules

NPM

npm package manager for Elixir.

Handle npm package aliases.

Analyzes package bundle-friendliness.

Handles bundledDependencies in package.json.

Global package cache.

Provides statistics about the npm package cache.

Detects and reads changelog files from installed packages.

Checks compatibility of packages with a target Node.js version.

Mix compiler that ensures npm packages are installed.

Shell completion support for mix npm commands.

Read npm configuration from .npmrc files.

Parses and analyzes .npmrc configuration files.

Multi-layer .npmrc resolution (project → user → global).

Parses corepack/packageManager field from package.json.

Detects version conflicts between dependency groups.

Analyzes and deduplicates npm dependency trees.

Analyzes how up-to-date dependencies are by comparing locked vs latest versions.

Dependency graph operations on the lockfile.

Checks for outdated packages by comparing installed versions against the latest available versions on the registry.

Generates formatted reports for outdated npm packages.

Analyzes and validates peer dependency declarations.

Deep peer dependency compatibility scanner.

Detects phantom (undeclared) dependencies.

Analyzes dependency version ranges for pinning strategy insights.

Topological sorting of packages for correct install/build order.

Computes aggregate statistics across all dependencies.

Build and query a dependency tree from the lockfile.

Detects unused and missing dependencies in a project.

Detects and reports deprecated packages in the dependency tree.

Analyzes deprecation messages to extract replacement suggestions and categorize deprecation reasons.

Formats installed npm packages for display, similar to mix deps.

Manages devDependencies from package.json.

Runs diagnostic checks on a project for common npm issues.

Health check for the npm installation.

Checks engine compatibility across all installed packages.

Environment checks for npm_ex.

Comprehensive project health scoring.

Compares two versions of a package to show what changed.

Handles package distribution metadata.

Parses and analyzes the engines field from package.json.

Structured error formatting for npm operations.

Analyzes file sizes within installed packages.

Formatting utilities for npm CLI output.

Shared formatting utilities.

Extracts git metadata for npm packages.

Manages .gitignore entries for npm projects.

Detects hoisting conflicts in the dependency tree.

Parses .npmignore and .gitignore files for package publishing.

Imports lockfiles from other package managers.

Generates and manages import maps for browser-native ES module loading.

Generates package.json files with sensible defaults.

Strict frozen install for CI environments.

Hooks for integrating npm operations with Mix workflows.

Detect and manage npm lifecycle scripts.

Manages local package linking via symlinks.

Creates node_modules from the global cache.

Builds npm.lock entries from resolved package versions.

Identifies and removes extraneous packages from node_modules.

Detects packages needing native rebuilds.

Implements NPM.install/2 for script-style usage outside Mix projects.

Analyzes and validates npm scripts from package.json.

Determines and configures package installation strategy.

Verify package integrity using Subresource Integrity (SRI) hashes.

Verifies installed packages match lockfile entries.

JSON helpers for npm manifest and lock files.

Read and write npm.lock lockfile.

Validates lockfile consistency against package.json dependencies.

Merge two lockfiles, preferring entries from the newer lockfile.

Reads and analyzes npm's package-lock.json format.

Implements npm shrinkwrap lockfile freezing.

Computes statistics about the lockfile itself.

Provides migration guidance between npm and lockfile versions.

Detects monorepo tooling and structure.

Parses and manages package bin field entries.

Resolve executable binaries from node_modules/.bin/.

npx-style execution — resolve and run binaries from installed packages.

Runs JavaScript entrypoints with Node.js using project node_modules resolution.

Inspect and query the node_modules directory.

Resolves dependency paths in the node_modules tree.

Parses Node.js version pinning files (.nvmrc, .node-version, .tool-versions).

Normalizes package.json data.

Handles optionalDependencies in package.json.

Checks package os/cpu field compatibility.

Handles npm overrides for forcing specific package versions.

Creates npm-compatible tarballs from local projects.

Analyzes which files would be included when publishing a package.

Discovers and aggregates funding information from installed packages.

Parses the funding field from package.json.

Read and write package.json files.

Analyzes package keywords for search and categorization.

Scans and reports licenses across the dependency tree.

Generate a complete package manifest from package.json.

Diffs two package.json manifests to determine what changed.

Extracts and analyzes author/contributor information from packages.

Parses the publishConfig field from package.json.

Scores individual package quality based on metadata completeness.

Repository field parsing and URL generation from package.json.

Parse npm package specifiers into structured data.

Create tarballs for npm publishing.

Disk cache for npm registry packuments.

Manages patched packages (patch-package style).

Platform compatibility checks for npm packages.

Selects optional dependencies that match the current platform.

Reports progress during npm operations (resolution, fetching, linking).

Initializes an Elixir project for npm dependency management.

Validates a package before publishing to the registry.

HTTP client for the npm registry.

Support for registry mirror URLs and fallback.

Resolve the registry URL for scoped packages.

Manages npm authentication tokens.

Constructs registry API URLs for package operations.

Extracts release notes from changelog content for specific version ranges.

Generates comprehensive project dependency reports.

Resolves conditional exports/imports from package.json.

Parse and resolve the exports field from package.json.

Resolve bare and relative import specifiers to files on disk.

Handles yarn-style resolutions in package.json.

HexSolver.Registry implementation for npm packages.

Software Bill of Materials (SBOM) generation.

Parses and manages npm package scopes.

Reads and manages npm scripts from package.json.

Local search functionality for installed packages.

Heuristics for recently created packages and freshly published versions.

Security audit for npm packages.

CVE (Common Vulnerabilities and Exposures) cross-referencing.

Checks lockfiles against known malicious or compromised npm package reports.

Optional OSV.dev lookup for malicious npm package advisories.

Detects and blocks exotic dependency specs in published package metadata.

Raised when a dependency points at an exotic source blocked by policy.

Supply chain provenance checking for npm packages.

Enforces registry origin policy for packuments and tarballs.

Raised when a package URL points at an untrusted registry origin.

Evaluates supply chain security posture of a project's dependencies.

Shared reporting helpers for npm security Mix tasks.

Utility functions for working with npm semver ranges.

Analyzes the sideEffects field from package.json.

Estimates install size and disk usage per package.

Compares two lockfile snapshots to determine what changed.

Collects statistics about the project's npm dependencies.

Download and extract npm package tarballs.

Formats and renders dependency trees for display.

Formats dependency trees for terminal display.

Analyzes the type field from package.json.

Suggests @types/* companion packages for dependencies that need TypeScript type definitions.

Resolves DefinitelyTyped @types/ packages for TypeScript consumers.

Validates package.json data against npm conventions.

Validate package.json fields.

Verifies that installed packages match the lockfile.

Advanced version range manipulation.

Utilities for npm version string manipulation.

Explains why a package is installed by tracing through the dependency tree.

Workspace management for npm monorepos.

Discovers and validates npm workspace packages.

Mix Tasks

Manage the global npm package cache.

Verify that the npm installation is consistent.

Remove the node_modules directory.

Output shell completion data for npm tasks.

Display the current npm configuration.

Re-resolve dependencies to minimize duplicate packages.

Show deprecated packages in the current lockfile.

Lists installed npm packages in a format similar to mix deps.

Show what changed since the last npm.lock was committed.

Run diagnostics on the npm installation.

Explain why a package is installed.

Show funding information for installed packages.

Fetch npm packages from npm.lock without re-resolving.

Show information about an npm package from the registry.

Create a new package.json in the current directory.

List the license of each installed package.

Link a local package directory into node_modules/.

List installed npm packages from npm.lock.

List installed npm packages from npm.lock.

Show npm packages with newer versions available.

Create a tarball of the current package.

Remove packages from node_modules/ not listed in npm.lock.

Publish the current package to the npm registry.

Remove node_modules/ and reinstall from the lockfile.

Remove an npm package from package.json and re-install.

Run a script defined in package.json.

Search for packages on the npm registry.

Set a configuration value in .npmrc.

Create an npm-shrinkwrap.json from the current npm.lock.

Analyze node_modules disk usage.

Display statistics about the npm dependency graph.

Display or verify npm authentication token status.

Display the full dependency tree from npm.lock.

Remove an npm package from package.json and re-install.

Update npm packages to the latest versions matching their ranges.

Display the installed version of npm_ex.

View detailed information about a package from the registry.

Show why an npm package is in the dependency tree.

Check installed packages for known security vulnerabilities.

Install npm packages in CI mode.

Execute a binary from node_modules/.bin/.

Install npm packages.

Check that node_modules matches npm.lock.