# promise-waterfall-native

> Small and simple function to use promises in waterfall

Latest version **1.0.1** (published 2017-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-waterfall-native
pnpm add promise-waterfall-native
yarn add promise-waterfall-native
bun add promise-waterfall-native
```

## 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 | 2017-01-11 |
| First published | 2017-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Doron Segal |
| Maintainers | doron2402 |
| Keywords | promises, waterfall, waterfall-promise, promise-waterfall |

## Links

- npm: https://www.npmjs.com/package/promise-waterfall-native
- Repository: https://github.com/doron2402/promise-waterfall
- Homepage: https://github.com/doron2402/promise-waterfall#readme
- Issues: https://github.com/doron2402/promise-waterfall/issues
- npm.io page: https://npm.io/package/promise-waterfall-native

## 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) — 2017-01-11
- 1.0.0 — 2017-01-11

## README

# promise-waterfall
small package to use native JS promises  

## example
```javascript
'use strict';
const Waterfall = require('../index');

const getSomeDataFromDB = () => {
  return new Promise((resolve) => {
    return setTimeout(() => {
      resolve([
        { id: 1 },
        { id: 2 }
      ]);
    }, 1000);
  });
};

const makeHttpCall = (result) => {
  const actions = result.map((obj) => {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        console.log(`making call using obj.id: ${obj.id}`);
        const val = obj.id + 10;
        return resolve(val);
      }, 3000);
    });
  });
  return Promise.all(actions);
};

Waterfall([getSomeDataFromDB, makeHttpCall])
.then((results) => {
  // results should be an array with two items [11,12]
  console.log(results);
})
.catch((err) => {
  console.log(err);
});

```

## For more example checkout the `tests` and the `example` directory

## License [DWTFYW] 
  Do what the fuck you want with this free to change/copy/etc..

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