-
Notifications
You must be signed in to change notification settings - Fork 31
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
Allow intercept of transitive require calls files. #3
Conversation
var paths = Module._nodeModulePaths(path.dirname(filename)); | ||
|
||
var m = new Module(filename, module.parent); | ||
|
||
var requireHook = opts.require; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require
option should be described in readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, for sure.
Still a work in progress. (which I now realize I did not mention).
@floatdrop I will have an |
@jamestalmage sure, no rush at all :) |
👍 Good idea! Lgtm when it has some docs. |
Has this feature been abandoned? Is there a better way to handle it? I'm just curious, for experimental purposes. |
I would say it is abandoned. We went a different route in AVA, and I'm probably not going to get around to fixing this. If someone else wants to take up the torch, be my guest. |
This paves the way for avajs/ava#156
This provides a really barebones API for intercepting require calls inside the module. It is up to the implementor to provide caching, resolve file names, load from disk, etc. (which we want to handle ourselves inside
ava
anyways).// @sindresorhus @vdemedes