<commit_before># [lil](http://lil-js.github.io)'-event [![Build Status](https://api.travis-ci.org/lil-js/event.svg?branch=master)][travis] [![Stories in Ready](https://badge.waffle.io/lil-js/event.png?label=ready&title=Ready)](https://waffle.io/lil-js/event) [![Code Climate](https://codeclimate.com/github/lil-js/event/badges/gpa.svg)](https://codeclimate.com/github/lil-js/event) [![Gitter chat](https://badges.gitter.im/lil-js/all.png)](https://gitter.im/lil-js/all)

<img align="center" height="150" src="http://lil-js.github.io/img/liljs-logo.png" />

Tiny event bus inspired in Node's EventEmitter

<table>
<tr>
<td><b>Name</b></td><td>event</td>
</tr>
<tr>
<td><b>Version</b></td><td>0.1.0</td>
</tr>
<tr>
<td><b>Size</b></td><td>2 KB / >1 KB (gzipped)</td>
</tr>
<tr>
<td><b>Environment</b></td><td>Node, Browser</td>
</tr>
</table>

## Installation

#### Node.js
```bash
npm install lil-event
```

#### Browser
Via [Bower](http://bower.io)
```bash
bower install lil-event
```
Via [Component](https://github.com/componentjs/component)
```bash
component install lil-js/event
```
Or loading the script remotely
```html
<script src="//cdn.rawgit.com/lil-js/event/0.1.0/event.js"></script>
```

### Environments

- Node.js
- Chrome >= 5
- Firefox >= 3
- Safari >= 5
- Opera >= 10
- IE >= 9

### Usage

You could fetch de module via `require()` if it's available.
Otherwise, global fallback will be used, exposed via `lil.Event`
```js
var lil = require('lil-event')
```

##### Basic emitter API
```js
function connectDB() {
  var bus = new lil.Event()
  db.connect(uri)
    .on('error', function (err) {
      emitter.emit('error', err)
    })
    .on('success', function () {
      emitter.emit('start', db)
    })
  return bus
}
```

#### Event bus suscription
```js
connectDB()
  .on('error', onErrorHandler)
  .on('start', onStartHandler)
```

## API

#### Event()

Create a new Event bus

#### Event#on(event, fn)
Alias: `addListener` Return: `this`<commit_msg>chore(docs): example improvements<commit_after># [lil](http://lil-js.github.io)'-event [![Build Status](https://api.travis-ci.org/lil-js/event.svg?branch=master)][travis] [![Stories in Ready](https://badge.waffle.io/lil-js/event.png?label=ready&title=Ready)](https://waffle.io/lil-js/event) [![Code Climate](https://codeclimate.com/github/lil-js/event/badges/gpa.svg)](https://codeclimate.com/github/lil-js/event) [![Gitter chat](https://badges.gitter.im/lil-js/all.png)](https://gitter.im/lil-js/all)

<img align="center" height="150" src="http://lil-js.github.io/img/liljs-logo.png" />

Tiny event bus inspired in Node's EventEmitter

<table>
<tr>
<td><b>Name</b></td><td>event</td>
</tr>
<tr>
<td><b>Version</b></td><td>0.1.0</td>
</tr>
<tr>
<td><b>Size</b></td><td>2 KB / >1 KB (gzipped)</td>
</tr>
<tr>
<td><b>Environment</b></td><td>Node, Browser</td>
</tr>
</table>

## Installation

#### Node.js
```bash
npm install lil-event
```

#### Browser
Via [Bower](http://bower.io)
```bash
bower install lil-event
```
Via [Component](https://github.com/componentjs/component)
```bash
component install lil-js/event
```
Or loading the script remotely
```html
<script src="//cdn.rawgit.com/lil-js/event/0.1.0/event.js"></script>
```

### Environments

- Node.js
- Chrome >= 5
- Firefox >= 3
- Safari >= 5
- Opera >= 10
- IE >= 9

### Usage

You could fetch de module via `require()` if it's available.
Otherwise, global fallback will be used, exposed via `lil.Event`
```js
var lil = require('lil-event')
```

##### Basic emitter API
```js
function connectDB() {
  var bus = new lil.Event()
  db.connect(uri)
    .on('error', function (err) {
      emitter.emit('error', err)
    })
    .on('success', function () {
      emitter.emit('start', db)
    })
  return bus
}
```

##### Events subscription
```js
connectDB()
  .on('error', onErrorHandler)
  .on('start', onStartHandler)
```

## API

#### Event()

Create a new Event bus

#### Event#on(event, fn)
Alias: `addListener` Return: `this`
{'fraction_non_alphanumeric': 0.23199393479909022, 'fraction_numerical': 0.00859236795552186, 'mean_word_length': 4.277333333333333, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 89, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1930891', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1522, 'n_words': 296}