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

Capturing Local require #37

Open
manwithsteelnerves opened this issue Apr 14, 2020 · 3 comments
Open

Capturing Local require #37

manwithsteelnerves opened this issue Apr 14, 2020 · 3 comments
Labels
agent-nodejs Make available for APM Agents project planning.

Comments

@manwithsteelnerves
Copy link

I tried this with Typescript and it worked great.
But is it possible to capture local project level imports too?

@watson
Copy link
Member

watson commented Apr 14, 2020

I'm not sure what you mean by "local project level imports"?

@manwithsteelnerves
Copy link
Author

I meant capturing a hook in require when we call
import user from '../user''
Here how can we get require-in-the-middle callback triggered when loading user module?

@watson
Copy link
Member

watson commented Apr 14, 2020

Got'ya 👍 No this isn't possible currently. You can hook into internal files inside of modules, but not the root project itself. I don't see why not though as long as the paths are always referenced according to the current working directory. This would be a nice enhancement to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

No branches or pull requests

3 participants