# wanikani-emitter

> Core functions for wanikani-emitter.

Latest version **1.1.1** (published 2015-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install wanikani-emitter
pnpm add wanikani-emitter
yarn add wanikani-emitter
bun add wanikani-emitter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-07-28 |
| First published | 2015-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sean Genabe |
| Maintainers | s4g6 |
| Keywords | wanikani, notification, notifier, events, emitter |

## Links

- npm: https://www.npmjs.com/package/wanikani-emitter
- Repository: https://github.com/seangenabe/wanikani-emitter
- Homepage: https://github.com/seangenabe/wanikani-emitter#readme
- Issues: https://github.com/seangenabe/wanikani-emitter/issues
- npm.io page: https://npm.io/package/wanikani-emitter

## Dependencies (3)

- [got](https://npm.io/package/got.md) ^4.1.0
- [delayer](https://npm.io/package/delayer.md) ^1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.8.5

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2015-07-28
- 1.0.0 — 2015-07-26

## README

# wanikani-notifier

Core functions for `wanikani-emitter`.

## Usage

See the usage instructions for [wanikani-notifier](https://github.com/seangenabe/wanikani-notifier#readme) for details.

### Inheritance

WaniKaniEmitter inherits from [EventEmitter](https://nodejs.org/api/events.html#events_class_events_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()` : Promise<int>
* `WaniKaniEmitter.scheduleNextCheck` : int
* `WaniKaniEmitter.requestUri(uri: string)` : Promise<Object> - denodeified [`request` function](https://www.npmjs.com/package/request#request-options-callback).
  * `promiseRejectError` - Error from [http.ClientRequest](https://nodejs.org/api/http.html#http_class_http_clientrequest).
  * `(await result).response` : [http.IncomingMessage](http://nodejs.org/api/http.html#http_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'`.

## See also

* [WaniKani Notifier UWP](https://github.com/seangenabe/WaniKani-Notifier-UWP) - port for Universal Windows Platform

---
_Source: https://npm.io/package/wanikani-emitter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
