
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
easy-dependency-loader
Advanced tools
A simple way to manage your dependencies and use "require" with no problems with relative paths. It is very useful to complex project structures and when it is needed to change some file from it's place.
A simple way to manage your dependencies and use "require" with no problems with relative paths. It is very useful to complex project structures and when it is needed to change some file from it's place.
[FEATURE] Migration to ES6 sintax!
[FEATURE] Refactoring (finally I had time to)!
[FEATURE] Unit tests!
[FEATURE] Add example folder
[FIX] Some fixes in Readme
EDL requires Node.js v6+ to run.
$ npm install --save easy-dependency-loader
Make sure you have a dependencies list in the following format:
{
...
"dependency1": "path/to/dependency1",
"dependency2": "path/to/dependency2",
"dependency3": "path/to/dependency3",
...
}
It can be described in a JSON file or in a object. The EDL works exactly in the same way of require, so, every load that works with require also works with EDL.
EDL.setDependencies(dependencies) //As an object descriptor
EDL.setDependencies('./path/from/project/root/to/dependencies.json') //Path to dependencies file
const myDependencies = require('./path/to/dependencies.json')
EDL.setDependencies(myDependencies) //Using an JSON module with require
//Then, you just need to call the name of module using the load() method. Is no necessary to use the relative path.
const Module = EDL.load('moduleName')
Module.doSomething()
const EDL = require('easy-dependency-loader')
//Passing a JSON path
EDL.setDependencies('./path/to/jsonfile/dependencies.json')
//Or passing a JSON module with require
const myDependencies = require('./configs/confgis.json')
EDL.setDependencies(myDependencies)
//Or passing an object
EDL.setDependencies({
"Dog": "./models/Dog.js",
"Falcon": "./models/birds/Falcon.js",
"Chicken": "./models/birds/Chicken.js",
"Worm": "./models/birds/insects/Worm.js"
})
//Finally, you can call the module in other place of project
const EDL = require('easy-dependency-loader')
const Dog = EDL.load('Dog')
Dog.bark()
//Lets suppose that async module is already installed
const EDL = require('easy-depenency-loader')
const async = EDL.load('async') // the same of const async = require('async');
const os = EDL.load('os') // the same of const os = require('os');
async.eachOf(os.cpus(), (cpu, key, next) => {
console.log('CPU [%s] PROPS: %j', key, cpu)
return next()
})
/*
Logs something like
CPU [0] PROPS: {"model":"Intel(R) Core(TM) ... }}
CPU [1] PROPS: {"model":"Intel(R) Core(TM) ... }}
...
*/
Pull requests are welcome!
In general, problems with using this module maybe are problems with require, such:
MIT
FAQs
A simple way to manage your dependencies and use "require" with no problems with relative paths. It is very useful to complex project structures and when it is needed to change some file from it's place.
The npm package easy-dependency-loader receives a total of 12 weekly downloads. As such, easy-dependency-loader popularity was classified as not popular.
We found that easy-dependency-loader 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.