
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
check-dependency-lists
Advanced tools
Check dependency lists are all in sync. This script checks the package.json
file against both the installed dependencies and the npm-shrinkwrap.json
file to make sure that they are all in sync and that all dependencies match the expected version ranges.
The function takes an options object which can contain
rootDir
- a relative path to the roo of the project; this should be the location of your package.json
and npm-shrinkwrap.json
files.callback
- A function to be called once the check is complete. An error will be provided as the only parameter if dependency mismatches are detected.
The check can be run using the example directory.
For example, if lodash
were installed without being saved to the package.json
file or shrinkwrapped, the following output would be produced.
> $ node example
There are dependencies which are not present in all dependency lists
[
{
"name": "lodash",
"presence": {
"packagejson": false,
"npmshrinkwrap": false,
"installed": true
},
"version": {
"packagejson": null,
"npmshrinkwrap": null,
"installed": "3.10.1"
}
}
]
[Error: Dependency check failed]
This check can been added as part of your build or linting tasks to cause a failure when dependencies are not in sync.
var checkDependencyLists = require('check-dependency-lists');
gulp.task('dependency-lint', function() {
return checkDependencyLists({
rootDir: '../'
});
});
FAQs
Check dependency lists are all in sync
We found that check-dependency-lists demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.