1.0.2 • Published 8 years ago
method-interceptor v1.0.2
Installation
npm install method-interceptor
Usage
intercept = require('method-interceptor');
var obj = { };
intercept(obj, function(method) {}, function(method) {});
- The 1st parameter is the object whose function calls you want to intercept
- The 2nd parameter is the function you'd like to call before the actual function is called
- The 3rd paramter is the function that gets called after the actual function is called
- Method obj contains .name, .args, .res