Nimble Polyglot Microcosm
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

hookit

1.1.3 • Public • Published

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
})

install

npm i hookit

Downloadsweekly downloads

1,140

version

1.1.3

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar