wanikani-emitter
v1.1.1
Published
Core functions for wanikani-emitter.
Downloads
20
Maintainers
Readme
wanikani-notifier
Core functions for wanikani-notifier
.
Usage
See the usage instructions for wanikani-notifier for details.
Inheritance
WaniKaniEmitter inherits from EventEmitter. However, no fields such as listener count are touched.
API
new WaniKaniEmitter(config)
config.key
config.errorSuspendDuration
config.notifiedSuspendDuration
config.waitingSuspendDuration
config.dashboardOnBothPending
config.minilag
emitter.start()
: Promise
emitter.stop()
WaniKaniEmitter.stop
Private methods
emitter.process()
: PromiseWaniKaniEmitter.scheduleNextCheck
: intWaniKaniEmitter.requestUri(uri: string)
: Promise - denodeifiedrequest
function.promiseRejectError
- Error from http.ClientRequest.(await result).response
: http.IncomingMessage(await result).body
: JSON|String|Buffer
Events
error
Will be emitted when an error is encountered. Important note: The emitter will continue running whatever error occurs, except for:
- API errors, which are tagged with
err.WaniKaniEmitter_type = 'APIError'
.
License
MIT