# run-waterfall-until

> Like run-waterfall but tasks can break out of the loop.

Latest version **1.0.1** (published 2024-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install run-waterfall-until
pnpm add run-waterfall-until
yarn add run-waterfall-until
bun add run-waterfall-until
```

## 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.1 |
| Published | 2024-02-13 |
| First published | 2018-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Damian Krzeminski |
| Maintainers | pirxpilot |
| Keywords | run-waterfall-until, async |

## Links

- npm: https://www.npmjs.com/package/run-waterfall-until
- Repository: https://github.com/pirxpilot/run-waterfall-until
- Homepage: https://github.com/pirxpilot/run-waterfall-until#readme
- Issues: https://github.com/pirxpilot/run-waterfall-until/issues
- npm.io page: https://npm.io/package/run-waterfall-until

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@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

## Recent versions

- 1.0.1 (latest) — 2024-02-13
- 1.0.0 — 2018-12-08

## README

[![NPM version][npm-image]][npm-url]
[![Build Status][build-image]][build-url]
[![Dependency Status][deps-image]][deps-url]

# run-waterfall-until

Like [run-waterfall] but tasks can break out of the loop.

## Install

```sh
$ npm install --save run-waterfall-until
```

## Usage

`run-waterfal-until` processes the list of tasks one by one, ending processing as soon as one of the tasks says so.
The next task is invoked with arguments set by the previous task.
It is a cross between async operations: waterfall and some.

```js
const waterfallUntil = require('run-waterfall-until');


waterfallUntil([
  function (arg1, arg2, callback) {
    // arg1 now equals 'foo', and arg2 - 'bar'
    // false means continue
    callback(null, false, 'one', 'two');
  },
  function (arg1, arg2, callback) {
    // arg1 now equals 'one', and arg2 - 'two'
    // true means break out of the loop
    callback(null, true, 'three');
  },
  function (arg1, callback) {
    // this function is not called since previous one has called callback with 'true' 
    callback(null, 'done', 'wohoo');
  }
], 'foo', 'bar', function (err, result1) {
   // result1 now equals 'three'
});

```

## License

MIT © [Damian Krzeminski](https://pirxpilot.me)

[run-waterfall]: https://www.npmjs.com/package/run-waterfall

[npm-image]: https://img.shields.io/npm/v/run-waterfall-until
[npm-url]: https://npmjs.org/package/run-waterfall-until

[build-url]: https://github.com/pirxpilot/run-waterfall-until/actions/workflows/check.yaml
[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/run-waterfall-until/check.yaml?branch=main

[deps-image]: https://img.shields.io/librariesio/release/npm/run-waterfall-until
[deps-url]: https://libraries.io/npm/run-waterfall-until

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