sanitycheck

2.0.2 • Public • Published

sanitycheck

ensure that all deps are present and accounted for CI / CD

js-standard-style

usage

add it as a dev dependency to your project

$ npm install --save-dev sanitycheck

and add it to your test command by editing your package.json:

{
  "scripts": {
    "test": "sanitycheck && <test runner>"
  }
}

Now you can run it using $ npm test and add it to your favorite testing or CI scripts.

If there are any errors, it exits with an error code of 1. As of 2.0.0, dependencies found in package.json but not used in code count as errors.

example output:

ok

Checking for unused or missing dependencies in package.json...
Validating all require statements...
···
OK

missing dependencies

Checking for unused or missing dependencies in package.json...
Dependencies missing in package.json: cool-ascii-faces

depenency case error

Checking for unused or missing dependencies in package.json...
Validating all require statements...
·☹ ·
1 Errors:
Error: Inside "c:\dev\sanitycheck\index.js"
Cannot resolve "./SUB" because:
"c:\dev\sanitycheck\SUB.js" doesn't exactly match the actual file path
"c:\dev\sanitycheck\sub.js"

kudos

makes use of excellent work from @thlorenz in valiquire and @jutaz in depscan

contributors

license

ISC. (c) MMXIV jden jason@denizac.org. See LICENSE.md

Package Sidebar

Install

npm i sanitycheck

Weekly Downloads

2

Version

2.0.2

License

ISC

Last publish

Collaborators