
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
dependency-install
Advanced tools
This plugin provides API to install npm dependencies in multiple package.json files by providing the root directory. It also allows to define custom local dependencies inside package.json
This plugin provides API to install npm dependancies in multiple package.json files by providing the root directory. It also allows to define custom local dependencies inside package.json.
To include dependency-install in your project use
npm install dependency-install --save
var di = require('dependency-install');
/* Executes npm install for all the nested pacakge.json files inside "<your-directory>" */
di.install(["<your-directory>"], function() {
// Things to do after dependency installation completes.
});
What if you need to share code, but don't wish to publish packages in NPM Registry? You can use the Custom Dependancies feature.
Create a directory(e.g 'your_local_dependancies') in your codebase to store each local dependency(library) code. Create directories for each of the dependencies with a index.js inside, as shown below.
__/your_local_dependancies
|__dependency-a
|__index.js
|__dependency-b
|__index.js
|__package.json // Optional if you have other npm dependancies
e.g of index.js inside dependency-a
var sayHello = function() {
console.log("hello");
};
module.exports.sayHello = sayHello;
Open a package.json file in your code base which depends on a local dependency (lets say 'dependency-a' and 'dependency-b') and include the section 'customDependencies', as shown below.
{
"dependencies": {},
"customDependencies": {
"dependency-a" : "local",
"dependency-b" : "local"
}
}
Initialize the custom dependency path for the library, as shown below.
var di = require('dependency-install');
/* This is to register the cusotm dependancies path */
di.init('your_local_dependancies');
/* Executes npm install for all the pacakge.json files inside "<your-directory>" */
di.install(["<your-directory>"], function() {
// Things to do after dependency installation completes.
});
Note: After running 'install' for all the nested package.json file dependencies installed from NPM Registry(Similar to running 'npm install' for each of the package) and also copies the custom dependancies from 'your_local_dependancies' directory to the respective 'node_modules' directory.
Finally in your code requrie the dependency similar in using a module from NPM Registry, as shown below.
var dependencyA = require('dependency-a');
dependencyA.sayHello(); // Prints "Hello"
FAQs
This plugin provides API to install npm dependencies in multiple package.json files by providing the root directory. It also allows to define custom local dependencies inside package.json
The npm package dependency-install receives a total of 27 weekly downloads. As such, dependency-install popularity was classified as not popular.
We found that dependency-install 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.