# echasync

> asyncronous foreach method

Latest version **0.1.3** (published 2017-01-21) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2017-01-21 |
| First published | 2016-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Abu Rawi |
| Maintainers | burawi |
| Keywords | foreach, async, asyncronous, array |

## Links

- npm: https://www.npmjs.com/package/echasync
- Repository: https://github.com/burawi/echasync
- Homepage: https://github.com/burawi/echasync#readme
- Issues: https://github.com/burawi/echasync/issues
- npm.io page: https://npm.io/package/echasync

## 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.3 (latest) — 2017-01-21
- 0.1.2 — 2017-01-21
- 0.1.1 — 2017-01-21
- 0.1.0 — 2016-12-28
- 0.0.1 — 2016-12-28

## README

## Prefer Videos ?

**_Watch [this video](https://www.youtube.com/watch?v=GjZGnrdnMyg) to see an example_**

# Installation

```
npm install echasync
```

# Usage

**_This is wrote following the [OADS Standards](https://github.com/ODNA/OADS)._**

```javascript
echasync.do([loopedArray],operation(next(),element,#index,[loopedArray]),callback())
```

Loops through an array asynchronously.
- [loopedArray]: The array you want loop through.
- operation(): The function you want to run for each element in the array.
    - next(): When you call to this function, you move to the next element.
    - element: The value of the element being handled.
    - #index: The index of the element being handled.
    - [loopedArray]: The array you are looping through.
- callback(): The function to run when all the elements are been handled.

Eg:

```javascript
var echasync = require('echasync');
var files = ['1.txt','2.txt','3.txt','4.txt','5.txt'];
var contents = [];
echasync.do(files,function (next,filename,index,files) {
    fs.readFile(filename,function(err,data){
        if(!err) {
            contents.push(data);
            next();
        }
    });
},function () {
    console.log(contents);
});
```

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