New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hookit

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hookit

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

0.1.3
Source
npm
Version published
Weekly downloads
457
-11.95%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

hook

FAQs

Package last updated on 04 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts