Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

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
})
Something went wrong with that request. Please try again.