assert-package-lock-is-consistent
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

assert-package-lock-is-consistent

NPM version dependencies: none code style: prettier Conventional Commits License MIT

Assert that package-lock.json is consistent with package.json, that is, both files have the same dependencies.

Install

Requires node@14 or higher:

npm install assert-package-lock-is-consistent --save-dev

Usage

This package verifies that package-lock.json and package.json files in your project have the same dependencies (dependencies, devDependencies, peerDependencies, and optionalDependencies).

If some dependency exists only in one file, or if the versions of some dependency in these files are different, the package throws an exception with a list of all such differences (prints a list and returns code 1 in CLI).

Dependency versions may difference if someone, for example, forgets to update package-lock.json file or include it in a commit.

The package works with package-lock.json file version 2 (npm@7 or higher).

CLI

Assert that package-lock.json has the same dependencies as package.json:

npx assert-package-lock-is-consistent

JavaScript/TypeScript API

import assertPackageLockIsConsistent from 'assert-package-lock-is-consistent';
// or
import {assertPackageLockIsConsistent} from 'assert-package-lock-is-consistent';

// assert that package-lock.json has the same dependencies as package.json
assertPackageLockIsConsistent();

License

MIT

Package Sidebar

Install

npm i assert-package-lock-is-consistent

Weekly Downloads

337

Version

1.0.0

License

MIT

Unpacked Size

7.3 kB

Total Files

5

Last publish

Collaborators

  • uid-11222