
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
npm-add-dependencies
Advanced tools
Add dependencies (latest or specified versions) to the package.json file without installing them
Warning! Starting with version 1.0.0
the package was renamed to add-dependencies.
This script adds dependencies (latest or specified versions) to the package.json file skipping the installation process.
Installing a dependency can have dangerous side effects, according to npm
:
it is possible for a maliciously-written npm package, when installed, to execute a script.
It's safer and faster to add dependencies to package.json
with this tool, and then only actually install them within a Docker container, for example, with docked-node
.
If not using with npx
(see below), you can install with:
$ npm install npm-add-dependencies [-g]
Go to a directory with the target package.json
and run:
$ npm-add-dependencies <dependencies> [target] [--no-overwrite]
or with npx
:
$ npx npm-add-dependencies <dependencies> [target] [--no-overwrite]
where dependencies
is the list of dependencies divided by space, and target
is one of the following:
--dev
/--save-dev
/-D
for devDependencies
--peer
/--save-peer
/-P
for peerDependencies
--optional
/--save-optional
/-O
for optionalDependencies
If no target
argument passed, dependencies are written to dependencies
.
Use --no-overwrite
flag to prevent already existing packages in package.json
from being overwritten.
Example:
$ npm-add-dependencies moment@2.0.0 react@16.8 redux eslint --dev
or with npx
:
$ npx npm-add-dependencies moment@2.0.0 react@16.8 redux eslint --dev
FAQs
Add dependencies (latest or specified versions) to the package.json file without installing them
We found that npm-add-dependencies 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.