# coforeach

> wrap to forEach method using generators

Latest version **0.0.1** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2017-01-17 |
| First published | 2017-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jesus Cereceres |
| Maintainers | cereceres |
| Keywords | co, generators, promise, coroutines, foreach, array |

## Links

- npm: https://www.npmjs.com/package/coforeach
- Repository: https://github.com/Cereceres/coForEach
- Homepage: https://github.com/Cereceres/coForEach#readme
- Issues: https://github.com/Cereceres/coForEach/issues
- npm.io page: https://npm.io/package/coforeach

## Dependencies (1)

- [co](https://npm.io/package/co.md) ^4.6.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-01-17

## README

# coForEach
co wrap to forEach method 

# Install
 ```bash
npm install coforeach
 ```

 # Usage

 ```js
let coFor = require('coforeach')
let returned = coFor(function * (item, index) {
        assert(item ===3) // the item is equal to item in array
        assert(this.test === 'context is the second arg') // the context is the passed as second arg to coForEach
    }, {test: 'context is the second arg'} // this is the context,
        [3] // this is array over which iterate)
    assert(returned instanceof Promise )
 ```

 # API
 coFor(iterater[, context, arrayToIterate]) -> Promise

 ## iterater(item, index) -> null
 iterater should be a generator receive the item and index of arrayToIterate  

 ## context 
 the context to call  iterater, default is {}

 ## arrayToIterate 
 The array to iterate, can be passed as thid arg or with context with is called coFor

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