Handles npm overrides for forcing specific package versions.
npm overrides allow replacing versions of transitive dependencies, useful for security patches and compatibility fixes.
Summary
Functions
Applies overrides to a lockfile, replacing matched versions.
Formats an override for display.
Finds which overrides would affect the current lockfile.
Parses overrides from package.json data.
Validates overrides — checks if specified versions are valid semver.
Types
Functions
Applies overrides to a lockfile, replacing matched versions.
Returns the modified lockfile and a list of applied overrides.
Formats an override for display.
Finds which overrides would affect the current lockfile.
Parses overrides from package.json data.
Supports both flat overrides {"pkg": "version"} and
nested overrides {"parent": {"pkg": "version"}}.
Validates overrides — checks if specified versions are valid semver.