Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid passing module as the first argument or make it optional #25

Open
davebaol opened this issue May 7, 2016 · 1 comment
Open

Avoid passing module as the first argument or make it optional #25

davebaol opened this issue May 7, 2016 · 1 comment

Comments

@davebaol
Copy link

davebaol commented May 7, 2016

What about using parent-module or directly callsites to avoid the need of passing module as the first argument?

@davebaol
Copy link
Author

davebaol commented May 7, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant