# waitress

> Simple flow control for multiple parallel async calls.

Latest version **0.1.5** (published 2013-03-29) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2013-03-29 |
| First published | 2012-03-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Adam Blackburn |
| Maintainers | regality |
| Keywords | flow-control, flow, waitress, async, parallel, callback |

## Links

- npm: https://www.npmjs.com/package/waitress
- Repository: https://github.com/ifit/waitress
- npm.io page: https://npm.io/package/waitress

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.1.5 (latest) — 2013-03-29
- 0.1.4 — 2013-02-13
- 0.1.3 — 2013-01-31
- 0.1.2 — 2012-08-07
- 0.1.1 — 2012-07-29
- 0.1.0 — 2012-07-29
- 0.0.4 — 2012-07-20
- 0.0.3 — 2012-07-12
- 0.0.2 — 2012-04-17
- 0.0.1 — 2012-03-13

## README

[![browser support](http://ci.testling.com/ifit/waitress.png)](http://ci.testling.com/ifit/waitress)

### Basic Usage

```javascript
var done = waitress(count, cb);
```

Waitress returns a function, `done`, that will wait to be called `count` times before executing the `cb` passed into it.

```javascript
var done = waitress(3, function(err) {
  if (err) throw err;
});

done();
done(new Error('oh noes')); // causes callback to be fired with an error condition
done(false); // also causes callback to be fired with an error condition
```

### Getting results

If done receives a second parameter, waitress will add that to an array,
which will be the second parameter given to the callback, as long as it
receives no errors.

The array will be built in the order the data is received, not the order
done appears in your code.

```javascript
var done = waitress(3, function(err, result) {
  if (err) throw err;
  result === ['a', 'b', 'c'];
});

done(null, 'a');
done(null, 'b');
done(null, 'c');
```

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