cid

check-installed-dependencies

Check if the currently installed packages match package.json

Showing:

Popularity

Downloads/wk

125

Maintenance

No Maintenance Data Available

Package

Dependencies

6

Size (min+gzip)

38.2KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

check-installed-dependencies

Check if the currently installed packages match package.json

(Based on the check-dependencies.js in fbjs)

Install

$ npm install --global check-installed-dependencies

Usage

$ check-installed-dependencies
package-a is not installed
package-b is outdated (1.2.3 does not satisify ^2.0.0)
var checkInstalledDependencies = require('check-installed-dependencies');

checkInstalledDependencies(packageDirectory, function(err, mismatches) {
  console.log(mismatches);
  // [{
  //   name: 'package-a',
  //   current: undefined,
  //   requested: '^1.0.0'
  // }, {
  //   name: 'package-b',
  //   current: '1.2.3',
  //   requested: '^2.0.0'
  // }]
});

Note: This module currently doesn't support "file:" or "github:" versions.

Usage in npm scripts

You can use check-installed-dependencies inside npm scripts.

$ npm install --save-dev check-installed-dependencies

Then in either prepublish or another npm script you can use check-installed-dependencies.

"scripts": {
  "prepublish": "check-installed-dependencies",
  "test": "check-installed-dependencies && mocha"
}

Note: Using check-installed-dependencies in prepublish will stop the package from being published.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100