文件名称:node-event-hooks:为 beforeafter require() 添加自定义钩子
文件大小:5KB
文件格式:ZIP
更新时间:2024-07-03 14:27:13
JavaScript
节点事件挂钩 用法 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");
【文件预览】:
node-event-hooks-master
----.gitignore(18B)
----package.json(747B)
----LICENSE(1KB)
----README.md(377B)
----example()
--------simple-express-app()
----lib()
--------node-event-hooks.js(2KB)