-
Notifications
You must be signed in to change notification settings - Fork 78
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
seeking feedback: debugging-aid #324
Comments
@naugtur would it make sense for you to give a presentation/walk through these tools in a Diagnostics WG meeting? |
As long as it's the one tomorrow, I can do it. |
@hekike can you add to the agenda for tomorrow? |
I presented this at the recent Diagnostics WG meeting and had some questions. People suggested I ask @mcollina these two: TL;DR bolded 1. One of my experiments (moduse.js) hooks into Module._cache with a getter and setter and prints stack traces leading to each place in the codebase where a certain module is required. I built it for the specific purpose of finding out which packages are requiring the 'net' or 'http' internal modules. I was surprised it actually works that way - when you require('net') cache is checked even though it's a built-in module and the cache is never populated. Is that desired behavior for some obvious reason I'm missing? I'm considering adding a PR with a test that would assert this and asking if the assertion should require or forbid this behavior. The tests for module loading I found didn't cover this case. 2. Another experiment is using perf tracing for output. This question is rather simple. I've rarely seen http servers written in Node.js with logic to gracefully shutdown by closing the sockets and removing all intervals. I'm offering to turn the answers I get into documentation ;) |
Some modules (https://www.npmjs.com/package/proxyquire) use that mechanism to intercept module loading to place mocks.
I do not know the answer to this. |
You can use the |
Any video demos of this? Just want the network tab. |
@vmarchaud thanks, will check it out. |
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
I'm experimenting with possible ways of debugging and would like to discuss their usefulness and validity.
https://github.com/naugtur/debugging-aid
The tools use not-so-well-known features of Node.js to help figure out common problems.
require
checking the cache for built-in modules as well is something I can rely on. Got the idea for this when wondering how to detect if a malicious library loadsnet
to call home.The text was updated successfully, but these errors were encountered: