node-require-directory
node-require-directory copied to clipboard
Avoid passing module as the first argument or make it optional
What about using parent-module or directly callsites to avoid the need of passing module
as the first argument?
Currently to achieve this result I have to use a proxy module like that
var requireDirectory = require('require-directory');
var parentModule = require('parent-module');
module.exports = function(path, options) {
return requireDirectory(require.cache[parentModule()], path, options);
}
It would be nice to have this feature supported directly.