var eventHooks = require('node-event-hooks');
eventHooks.on('beforeRequire', function() {
this.requireStartTime = Date.now();
});
eventHooks.on('afterRequire', function(path) {
console.log("Took %dms to require '%s'", Date.now() - this.requireStartTime, path);
});
eventHooks.run("./www.js");
-
Notifications
You must be signed in to change notification settings - Fork 0
Add custom hooks for before/after require().
License
drew-walker/node-event-hooks
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Add custom hooks for before/after require().
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published