Skip to content

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

Notifications You must be signed in to change notification settings

CrabDude/hookit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published