Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
dependency-diff
Advanced tools
Generate npm install commands or objects from the diff of two package.json files
Generate npm install commands or objects from the diff of two package.json files
Use this module when you want to determine differences in package.json dependencies. This module is part of MinerLabs's continuous build and deploy system. Utilizing this module you can minimize downtime with targeted installs and uninstalls.
The best way for now to learn what the module does and expects is to look at the tests, however here is a short write up
var DepDiff = require('dependency-diff')
var left = require('package.json')
var right = require('other_package.json');
DepDiff().left(left).right(right).toObject()
/*
returns obj e.g.
{ dependencies:
[ { operation: 'edit',
name: 'package-1',
version: '1.0.1',
cmd: 'npm install "package-1@1.0.1" --spin=false --color=true --production --loglevel=http' },
{ operation: 'new',
name: 'extra-package',
version: '1.0.0',
cmd: 'npm install "extra-package@1.0.0" --spin=false --color=true --production --loglevel=http' } ],
devDependencies:
[ { operation: 'edit',
name: 'dev-package-1',
version: '1.0.1',
cmd: 'npm install "dev-package-1@1.0.1" --spin=false --color=true --production --loglevel=http' },
{ operation: 'new',
name: 'extra-package',
version: '1.0.0',
cmd: 'npm install "extra-package@1.0.0" --spin=false --color=true --production --loglevel=http' } ],
optionalDependencies:
[ { operation: 'edit',
name: 'optional-package-1',
version: '1.0.1',
cmd: 'npm install "optional-package-1@1.0.1" --spin=false --color=true --production --loglevel=http' },
{ operation: 'delete',
name: 'only-left',
version: '1.0.0',
cmd: 'npm uninstall only-left' },
{ operation: 'new',
name: 'extra-package',
version: '1.0.0',
cmd: 'npm install "extra-package@1.0.0" --spin=false --color=true --production --loglevel=http' } ] }
*/
DepDiff().left(left).right(right).toCmdList()
/*
[ 'npm install "package-1@1.0.1" --spin=false --color=true --production --loglevel=http',
'npm install "extra-package@1.0.0" --spin=false --color=true --production --loglevel=http',
'npm install "dev-package-1@1.0.1" --spin=false --color=true --production --loglevel=http',
'npm install "extra-package@1.0.0" --spin=false --color=true --production --loglevel=http',
'npm install "optional-package-1@1.0.1" --spin=false --color=true --production --loglevel=http',
'npm uninstall only-left',
'npm install "extra-package@1.0.0" --spin=false --color=true --production --loglevel=http' ]
*/
FAQs
Generate npm install commands or objects from the diff of two package.json files
The npm package dependency-diff receives a total of 418 weekly downloads. As such, dependency-diff popularity was classified as not popular.
We found that dependency-diff 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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.