Programmatic API for linting npm or yarn lockfiles to detect security and policy issues. Current stable version is 5.9.2, released as part of the lockfile-lint monorepo. It provides validators for HTTPS scheme, allowed hosts, package name consistency, URI schemes, and integrity hash types. Outputs structured success/error objects. Requires Node >=16.0.0.
npm install lockfile-lint-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a package-lock.json file and validates that all packages are hosted on the allowed 'npm' host.
Upgrade Node.js to version 16 or later.
Use ValidateHttps instead of ValidateScheme.
Ensure packages have a 'resolved' field if you want them validated.
Run 'npm install lockfile-lint-api' and ensure import path is correct.
Check that you instantiated the validator correctly and are calling the appropriate method (e.g., validator.validate()).
No dependency data recorded yet.