1.0.0 • Published 7 years ago
require-dir-lite v1.0.0
Require-dir-lite
Super simple to use
A helper to require() one directory recursively with no configuration params.
Installation
npm install require-dir-liteUsage
There is only one param(default: '.') you would concern: the directory path.
let requireDir = require('require-dir-lite');
let dir = requireDir('./somewhere');Given this directory structure:
dir
+ a.js
+ b.json
+ c
+c-1.js
+.dumb.js
+ d.txtrequireDir('./dir') will return the equivalent of:
{
a: require('./dir/a.js'),
b: require('./dir/b.json'),
c: {
c-1: require('./dir/c/c-1.js')
}
}