Similar to require-all, massquire
requires directories of modules into objects.
npm install massquire
var massquire = require('massquire');
var modules = massquire(dirname, opts);
Type: String
The name of the directory (path) that should be required.
Type: Object
Type: Boolean
Default: true
Requires all modules in the given directory and its subdirectories by default. Set recurse
to false
to require only the given directory.
Type: Function
Function that receives the full path of a file and should return true
to include the file.
Type: Function
Function that receives the full path of a file and should return true
to exclude the file.
Type: Function
Function that receives the full path of a directory and should return true
to include the directory.
Type: Function
Function that receives the full path of a directory and should return true
to exclude the directory.
Type: Function
Default: Strip .js or .json and camelCase
Function that receives the filename for each module and should return the keyname where the module will be stored to the object.
function(filename) {
// format the filename
return key;
}
Type: Function
Function that receives each required module and should return the desired module value.
function(module) {
return module();
}