CallTrace
npm
Install with$ npm install calltrace
Usage
var trace =
Calltrace will emit capture
events, keep in mind to bind to them:
trace
Where the info
will consist of an object with the following
properties:
- String name: name of captured function
- Function fn: original (replaced) function,
- Array argv: array of arguments passed into the function
- Number time: milliseconds spent int the function
- Object stack: verbose stack trace, if enabled
In case you want to monitor a globally available function:
trace // ORtrace
Or, if you want to keep an eye on a method you only have access to in this scope:
trace
Also, in case you want to turn off stack trace capturing,
pass false
as last parameter to capture()
:
trace // ORtrace