New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

assert-package-lock-is-consistent

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assert-package-lock-is-consistent

Assert that package-lock.json is consistent with package.json

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
242
decreased by-36.15%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 23 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc