instrument-methods
Simple object method instrumentation.
$ npm install --save instrument-methods
Usage
; const instance = { ... } { ... }; ; instance; // Logs:// "doThat" is about to be called!, 1, 2, 3// "doThat" was called!, 1, 2, 3
Even though it modifies the object, instrumentMethods
also returns a reference to the modified object so it can be used as part of an expression:
const after = console; const instance = ;