All Projects → jamiebuilds → Check Installed Dependencies

jamiebuilds / Check Installed Dependencies

Licence: other
Check if the currently installed packages match package.json

Programming Languages

javascript
184084 projects - #8 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].