https://github.com/npm/lock-verify
Report if your package.json is out of sync with your package-lock.json
https://github.com/npm/lock-verify
Last synced: 10 months ago
JSON representation
Report if your package.json is out of sync with your package-lock.json
- Host: GitHub
- URL: https://github.com/npm/lock-verify
- Owner: npm
- License: isc
- Archived: true
- Created: 2017-08-10T20:44:47.000Z (almost 9 years ago)
- Default Branch: latest
- Last Pushed: 2022-11-16T19:11:17.000Z (over 3 years ago)
- Last Synced: 2024-10-01T16:06:34.115Z (almost 2 years ago)
- Language: JavaScript
- Size: 35.2 KB
- Stars: 38
- Watchers: 11
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Note: pending imminent deprecation
**This module will be deprecated once npm v7 is released. Please do not rely
on it more than absolutely necessary (ie, only if you are depending on
it for use with npm v6 internal dependencies).**
----
# lock-verify
Report if your package.json is out of sync with your package-lock.json.
## USAGE
```
const lockVerify = require('lock-verify')
lockVerify(moduleDir).then(result => {
result.warnings.forEach(w => console.error('Warning:', w))
if (!result.status) {
result.errors.forEach(e => console.error(e))
process.exit(1)
}
})
```
As a library it's a function that takes the path to a module and returns a
promise that resolves to an object with `.status`, `.warnings` and `.errors`
properties. The first will be true if everything was ok (though warnings
may exist). If there's no `package.json` or no lockfile in `moduleDir` or they're
unreadable then the promise will be rejected.