0.0.2 • Published 9 years ago

hijack-function v0.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

Hijack Function

Hijack the inner-workings of functions

Install

$ npm install --save hijack-function

Usage

var HijackFunction = require("hijack-function")

Greetings = {
  hello: function(){
    console.log("Hi there!")
  }
}

HijackFunction.before(global, "Greetings.hello", function(){
  console.log("hijacked")
})

Greetings.hello()

API

before(context, functionString, functionToInsert)

NameTypeDescription
contextObjectThe context of the function you want to hijack
functionStringStringString that represents the function you want to hijack
functionToInsertFunctionThe function you want to be inserted before the function to be hijacked
0.0.2

9 years ago

0.0.1

9 years ago