hookit

A function for shimming all node.js core IO calls allowing callback wraping.

hook

Shim all core IO calls and allow callback shimming via wrap function.

###Installation

$ npm install hookit

###Usage:

hookit(function generateShim(callback, fnName) {
  return function() {
    try {
      callback.apply(this, arguments);
    } finally {
      console.log('bummer.')
    }
  }
})

process.nextTick(function() {
  throw new Error('here') // Will log "bummer" before we crash on error
})

HomePage

https://github.com/CrabDude/hookit

Repository

https://github.com/CrabDude/hookit


上一篇:buffer-loader
下一篇:trycatch

相关推荐

暂无相关文章

官方社区

扫码加入 JavaScript 社区