# async-ear

> Manage and call async functions

Latest version **1.0.0** (published 2015-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-ear
pnpm add async-ear
yarn add async-ear
bun add async-ear
```

## 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.0.0 |
| Published | 2015-10-24 |
| First published | 2015-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | listen, async, ear, function |

## Links

- npm: https://www.npmjs.com/package/async-ear
- Repository: https://github.com/bendrucker/async-ear
- Homepage: https://github.com/bendrucker/async-ear#readme
- Issues: https://github.com/bendrucker/async-ear/issues
- npm.io page: https://npm.io/package/async-ear

## Dependencies (5)

- [ap](https://npm.io/package/ap.md) ~0.2.0
- [to-array](https://npm.io/package/to-array.md) ~0.1.4
- [run-series](https://npm.io/package/run-series.md) ~1.1.4
- [run-parallel](https://npm.io/package/run-parallel.md) ~1.1.4
- [assert-function](https://npm.io/package/assert-function.md) ~1.0.0

## Recent versions

- 1.0.0 (latest) — 2015-10-24

## README

# async-ear [![Build Status](https://travis-ci.org/bendrucker/async-ear.svg?branch=master)](https://travis-ci.org/bendrucker/async-ear)

> Manage and call async functions

async-ear can register and manage a set of functions to call in parallel (default) or series with the same arguments.

## Install

```
$ npm install --save async-ear
```


## Usage

```js
var Ear = require('async-ear')
// or Ear = require('async-ear/series')

var listeners = Ear()
listeners.add(function (a, callback) {
  //=> a === 1
  callback()
})
listeners(1, function done (err) {
  //=> err === null  
})
```

## API

#### `Listeners()` -> `function`

Create a new listener group. Returns a `listeners` function that will call all listeners with the provided arguments. The listeners should provide a callback as its last argument which will be called with an error (or `null`).

#### `listeners.add(listener)` -> `function`

Adds a new listener. Returns a `remove` function that will remove the new listener when called. Each listener should expect a callback as its final argument.

##### listener

*Required*  
Type: `function`
Arguments: `args..., callback`

A listener to trigger when the parent function is called.

## Related
* [ear](https://github.com/bendrucker/ear): synchronous version

## License

MIT © [Ben Drucker](http://bendrucker.me)

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