1.0.0 • Published 7 years ago

require-dir-as-map v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

require-dir-as-map

Build
Status npm
version

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 - krolowatgmail.com