method-interceptor
1.0.2 • Public • Published
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
Package Sidebar
Install
Weekly Downloads