require-dir-as-map
v1.0.0
Published
Require a directory as a new Map()
Downloads
3
Readme
require-dir-as-map
Require a directory and get back a
new Map()
Usage
const requireDirAsMap = require('require-dir-as-map');
const filter = (file) => {
return file;
};
const map = ({ file, module }) {
return module.somethingThere || file.split('.')[0];
}
requireDirAsMap('/my-directory/', { filter, map });
License
Licensed under The MIT License Redistributions of files must retain the above copyright notice.
Author
Vinícius Krolow - krolow[at]gmail.com