SimpleDebugger
A simple way to debug events and methods of your classes.
yarn add simple-debugger
const { inherits } = require('util')
const { debugEvents } = require('simple-debugger')
const { debugMethods } = require('simple-debugger')
const EventEmitter = require('events')
inherits(SomeClass, EventEmitter)
function SomeClass() {
debugEvents(this)
debugMethods(this, [ 'on', 'once', 'emit' ])
this.init()
}
SomeClass.prototype.init = function() {
this.emit('ready')
}
new SomeClass()
const { debugEvents } = require('simple-debugger')
const { debugMethods } = require('simple-debugger')
const request = require('request')
const google = request('https://google.com')
debugEvents(google, [], 'google')
debugMethods(google, [ 'on', 'once', 'emit' ], 'google')