Open dylang opened 10 years ago
As you can see, requireHook
deliver more relevant bits to the listener (parent, module, exports)... so we can definitely get more detailed info regarding the loaded module (parent, detection of internal Node.js modules require() => filename === name
, exports ...etc).
If you have something in mind related to how the hierarchy view should show-up, fork & create a PR for this. Having kind of new CLI config like --show=tree|list(default)
may be handy...
PS-1: requireHook will end up as a separate module (require-time-hook) since it may be useful in multiple scenarios (module profilers, static analyzers, dependency reporters ... etc). As a result, time-require will be just a user
of this simple but I thing powerful new utility Node.js module.
PS-2: I'm using BitBucket because comparing it with GitHub, additionally supports Mercurial and UNLIMITED PRIVATE repositories (for individuals and for teams with less then 5 users). Since it is not so popular & social as GitHub, as a general rule I'll created associated mirrors on GitHub to support GitHub users as well.
In this example:
The output does not tell us that
b.js
was required bya.js
. That means it is not clear that 1 second ofa.js
is causedb.js
, and speeding upb.js
will in turn speed upa.js
.BTW - thank you for the github mirror. I wanted to create this ticket earlier but I've been too busy to set up a bitbucket account and figure out that service works.