Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
LICENSE | D | 12-May-2024 | 752 | 15 | 11 | |
README.md | D | 12-May-2024 | 703 | 23 | 18 | |
index.js | D | 12-May-2024 | 2.9 KiB | 82 | 74 | |
package.json | D | 12-May-2024 | 1.6 KiB | 63 | 62 |
README.md
1# lock-verify 2 3Report if your package.json is out of sync with your package-lock.json. 4 5## USAGE 6 7``` 8const lockVerify = require('lock-verify') 9lockVerify(moduleDir).then(result => { 10 result.warnings.forEach(w => console.error('Warning:', w)) 11 if (!result.status) { 12 result.errors.forEach(e => console.error(e)) 13 process.exit(1) 14 } 15}) 16``` 17 18As a library it's a function that takes the path to a module and returns a 19promise that resolves to an object with `.status`, `.warnings` and `.errors` 20properties. The first will be true if everything was ok (though warnings 21may exist). If there's no `package.json` or no lockfile in `moduleDir` or they're 22unreadable then the promise will be rejected. 23