Decorator Debug
Simple ES7 decorator for debugging classes and methods.
Installation
npm install decorator-debug --save
Usage
Every time the class or method is called, a console log will be emitted with the property name
, result
, args
, context
and time
taken.
@debug @debug { return true } 1 2 3method'test' //=> new Demo { name: 'Demo', result: {}, context: {}, args: [ 1, 2, 3 ], time: 0.2647359999999992 }//=> Demo#method { name: 'method', result: true, context: {}, args: [ 'test' ], time: 0.029204000000000008 }
P.S. You can debug conditionally.
@ {}
License
MIT