
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
auto-load-dir
Advanced tools
A simple module to auto load modules from a dir. It was originally intended for loading express routes from routes/, but it could be used to load models as well.
npm install --save auto-load-dir
Most interaction is done via the Loader class. As a convinence, a helper method is provided as module.exports, which simply creates a new Loader with the provided arguments.
var Loader = require('auto-load-dir').Loader;
// Or
var Loader = require('auto-load-dir');
// Later
var routesLoader = new Loader(__dirname + '/routes', [app, express], function(){
// Yay! Routes are loaded.
});
// Even later
var modelLoader = new Loader(__dirname + '/models', function(model){
model.init(mongoose, models);
model.start();
model.blowUpPluto(); // Who knows.
}
dir is the directory to load all js files in.
args is an Array of arguments that get passed into module.exports for each module
OR
handler is a function that gets called with one argument, the already required module.
callback (optional) gets called with no paramaters if loading is sucessful, or an error if it's not.
PRs are welcome! This was a simple file that I had in a project that needed encapsulating. Please add functionality and open a PR! It uses the AirBnB JavaScript style guide.
git clone https://github.com/ariporad/auto-load-dir
cd auto-load-dir
npm install
grunt test
# (Also avalible is grunt lint)
FAQs
A simple module to auto load modules from a dir.
We found that auto-load-dir 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.