Skip to content

Util to check that package.json and npm-shrinkwrap.json are in sync.

Notifications You must be signed in to change notification settings

redbooth/npm-shrinkwrap-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATION NOTICE

This module is deprecated. If you want to painlessly lock your dependencies and check they are in sync you should use yarn and pretend npm shrinkwrap ( and this module ) never existed.

npm-shrinkwrap-check

Checks that package.json and npm-shrinkwrap.json files are always in sync so you don't commit out-of-sync dependencies in your code.

installation

Install it globally running

$ npm install -g npm-shrinkwrap-check

usage

In a folder that contains a package.json run the following command:

$ npm-shrinkwrap-check

This will perform the following checks:

  • Both package.json and npm-shrinkwrap.json exist.
  • There are no dependencies in package.json that are not contained in npm-shrinkwrap.json

options

Options:
  -3, --v3       Perform check taking npm3 flat structure into account.
  -d, --dev      Check devDependencies.
  -h, --help     Show this help message.
  -v, --verbose  Run in verbose mode
  -V, --version  Outputs version

add as git hook

It is a good practice that you add npm-shrinkwrap-check as a git hook.

To add a pre-push hook create a .git/hooks/pre-push in your repo with the following:

#!/bin/sh

npm-shrinkwrap-check

This will prevent you from pushing out-of-sync package.json and npm-shrinkwrap.json files to your repo.

About

Util to check that package.json and npm-shrinkwrap.json are in sync.

Resources

Stars

Watchers

Forks

Packages

No packages published