# jiken

> Browser EventEmitter

Latest version **0.2.3** (published 2017-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install jiken
pnpm add jiken
yarn add jiken
bun add jiken
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2017-04-29 |
| First published | 2017-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Douman |
| Maintainers | douman |
| Keywords | event, EventEmitter |

## Links

- npm: https://www.npmjs.com/package/jiken
- Repository: https://github.com/DoumanAsh/jiken
- Homepage: https://github.com/DoumanAsh/jiken#readme
- Issues: https://github.com/DoumanAsh/jiken/issues
- npm.io page: https://npm.io/package/jiken

## 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

- 0.2.3 (latest) — 2017-04-29
- 0.2.1 — 2017-04-29
- 0.2.0 — 2017-04-29
- 0.1.0 — 2017-04-28

## README

# 事件(jiken)

[![Build Status](https://travis-ci.org/DoumanAsh/jiken.svg?branch=master)](https://travis-ci.org/DoumanAsh/jiken)
[![Coverage Status](https://coveralls.io/repos/github/DoumanAsh/jiken/badge.svg?branch=master)](https://coveralls.io/github/DoumanAsh/jiken?branch=master)
[![Package version](https://img.shields.io/npm/v/jiken.svg)](https://npmjs.org/package/jiken)

Simple EventEmitter for Browser.

## Documentation

* [API](https://doumanash.github.io/jiken)

## Overview

This package's goal is to emulate node.js [EventEmitter](https://nodejs.org/api/events.html).

But adds some cool flavour on top of it.

### Async mode

Contrary to node.js EventEmitter, Jiken gives you [possibility](https://github.com/DoumanAsh/jiken/blob/master/docs/API.md#Jiken+not_sync) to run listeners asynchronously.

Under hood it uses [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout)

### Install

#### npm

```
npm install --save jiken
```

#### Browser

Alternatevly you can grab built copy from repository:
```
<script src="https://github.com/DoumanAsh/jiken/releases/download/0.2.2/jiken.min.js">
```

### Usage

#### Extend Class

```js
const Jiken = require('jiken').Jiken;

class MySuperEmitter extends Jiken {
    constructor() {
        super()
        this.on('some-event', () => console.log('trigger some-event'));
    }
}

const emitter = new MySuperEmitter();
emitter.emit('some-event');
```

#### Directly Create Instance

```js
const Jiken = require('jiken').Jiken;

const test = new Jiken();

test.on('lolka', () => console.log('lol'));
test.emit('lolka');
```

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