# async-reduce-p

> Combine Promise and Array.prototype.reduce into asyncReduce

Latest version **1.0.0** (published 2018-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-reduce-p
pnpm add async-reduce-p
yarn add async-reduce-p
bun add async-reduce-p
```

## 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 | 2018-08-17 |
| First published | 2018-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rococolate |
| Maintainers | rococolate |
| Keywords | async, reduce, Promise |

## Links

- npm: https://www.npmjs.com/package/async-reduce-p
- Repository: https://github.com/Rococolate/asyncReduce
- Homepage: https://github.com/Rococolate/asyncReduce#readme
- Issues: https://github.com/Rococolate/asyncReduce/issues
- npm.io page: https://npm.io/package/async-reduce-p

## 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

- 1.0.0 (latest) — 2018-08-17

## README

# asyncReduce
Combine Promise and Array.prototype.reduce into  asyncReduce

## Use

```js
const asyncReduce = require('asyncReduce');

const list = [1,2,3,4,5];

async function sleep(time){
  await new Promise((resolve) => {
    setTimeout(resolve, time);
  });
}

asyncReduce(list, async (pre,cur,index,array)=>{
  const totle = pre + cur;
  console.log(totle);
  await sleep(1000);
  return totle; 
},0)
.then(value => console.log(value))
.catch(err=> console.log(err));

```


output:

```js
1
(after 1000ms)
3
(after 1000ms)
6
(after 1000ms)
10
(after 1000ms)
15
(after 1000ms)
15
```

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