require-plus
v2.2.1
Published
better require for directories
Downloads
20
Readme
require-plus
Node module for requiring a directory tree, it will throw if not a valid directory and it will also throw if the object is not exported properly or cannot be required by require.
##Installation
npm install require-plus
##Usage
const options = {
blacklist: ['node_modules', '.git', '.idea'],
extensions: ['.js','.json'],
directory: ['./test', './some/path', './some/other/path'] // can be a string or an array
};
const plus = require('require-plus')(options);
console.log(plus);
//plus is an object containing modules exported from above directories
##Todo
- ~~100% code coverage~~
- ~~Handle require errors better~~
- Add silent error handling option to not throw if something cannot be required by require