Skip to content

drew-walker/node-event-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-event-hooks

usage

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");

About

Add custom hooks for before/after require().

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published