API Reference NPM v#0.6.0

Copy Markdown View Source

Modules

NPM

npm package manager for Elixir.

Handle npm package aliases.

Security audit for npm packages.

Parses and manages package bin field entries.

Resolve executable binaries from node_modules/.bin/.

Analyzes package bundle-friendliness.

Handles bundledDependencies in package.json.

Strict frozen install for CI environments.

CVE (Common Vulnerabilities and Exposures) cross-referencing.

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 corepack/packageManager field from package.json.

Analyzes and deduplicates npm dependency trees.

Detects unused and missing dependencies in a project.

Detects version conflicts between dependency groups.

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

Dependency graph operations on the lockfile.

Resolves dependency paths in the node_modules tree.

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 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.

Compares two versions of a package to show what changed.

Handles package distribution metadata.

Health check for the npm installation.

Finds packages installed at multiple versions in the dependency tree.

Checks engine compatibility across all installed packages.

Parses and analyzes the engines field from package.json.

Environment checks for npm_ex.

Structured error formatting for npm operations.

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

Analyzes file sizes within installed packages.

Formatting utilities for npm CLI output.

Shared formatting utilities.

Discovers and aggregates funding information from installed packages.

Parses the funding field from package.json.

Extracts git metadata for npm packages.

Manages .gitignore entries for npm projects.

Advanced graph operations on dependency graphs.

Comprehensive project health scoring.

Detects hoisting conflicts in the dependency tree.

Hooks for integrating npm operations with Mix workflows.

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.

Determines and configures package installation strategy.

Verify package integrity using Subresource Integrity (SRI) hashes.

Verifies installed packages match lockfile entries.

Analyzes package keywords for search and categorization.

Scans and reports licenses across the dependency tree.

Detect and manage npm lifecycle scripts.

Manages local package linking via symlinks.

Creates node_modules from the global cache.

Merge two lockfiles, preferring entries from the newer lockfile.

Read and write npm.lock lockfile.

Validates lockfile consistency against package.json dependencies.

Computes statistics about the lockfile itself.

Generate a complete package manifest from package.json.

Diffs two package.json manifests to determine what changed.

Provides migration guidance between npm and lockfile versions.

Detects monorepo tooling and structure.

Inspect and query the node_modules directory.

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

Normalizes package.json data.

Parses and analyzes .npmrc configuration files.

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

Handles optionalDependencies in package.json.

Checks package os/cpu field compatibility.

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

Generates formatted reports for outdated npm packages.

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.

Read and write package.json files.

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

Scores individual package quality based on metadata completeness.

Parse npm package specifiers into structured data.

Computes available package updates by comparing locked vs latest versions.

Create tarballs for npm publishing.

Manages patched packages (patch-package style).

Analyzes peer dependency declarations and their resolution status.

Analyzes and validates peer dependency requirements.

Deep peer dependency compatibility scanner.

Extracts and analyzes author/contributor information from packages.

Detects phantom (undeclared) dependencies.

Platform compatibility checks for npm packages.

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

Initializes an Elixir project for npm dependency management.

Supply chain provenance checking for npm packages.

Identifies and removes extraneous packages from node_modules.

Validates a package before publishing to the registry.

Parses the publishConfig field from package.json.

Detects packages needing native rebuilds.

HTTP client for the npm registry.

Support for registry mirror URLs and fallback.

Constructs registry API URLs for package operations.

Extracts release notes from changelog content for specific version ranges.

Generates comprehensive project dependency reports.

Repository field parsing and URL generation from package.json.

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.

Resolve the registry URL for scoped packages.

Analyzes and validates npm scripts from package.json.

Reads and manages npm scripts from package.json.

Local search functionality for installed packages.

Utility functions for working with npm semver ranges.

Implements npm shrinkwrap lockfile freezing.

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.

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

Download and extract npm package tarballs.

Manages npm authentication tokens.

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

Check installed packages for known security vulnerabilities.

Manage the global npm package cache.

Verify that the npm installation is consistent.

Install npm packages in CI mode.

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.

Execute a binary from node_modules/.bin/.

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.

Install npm packages.

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.

Check that node_modules matches npm.lock.

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.