# array-generators

> Array functions (forEach, filter, map) with support for generator functions

Latest version **1.1.0** (published 2015-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-generators
pnpm add array-generators
yarn add array-generators
bun add array-generators
```

## 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.1.0 |
| Published | 2015-09-06 |
| First published | 2015-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Vadim Demedes |
| Maintainers | vdemedes |
| Keywords | foreach, filter, map, es6, generator |

## Links

- npm: https://www.npmjs.com/package/array-generators
- Repository: https://github.com/vdemedes/array-generators
- Issues: https://github.com/vdemedes/array-generators/issues
- npm.io page: https://npm.io/package/array-generators

## Dependencies (1)

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

## Recent versions

- 1.1.0 (latest) — 2015-09-06
- 1.0.0 — 2015-03-11

## README

# array-generators [![Circle CI](https://circleci.com/gh/vdemedes/array-generators.svg?style=svg)](https://circleci.com/gh/vdemedes/array-generators)

Array methods (forEach, forEachSeries, map, filter) with support for generator functions.


### Installation

```
$ npm install array-generators --save
```


### Usage

```js
let array = require('array-generators');

let forEach = array.forEach;
let filter = array.filter;
let map = array.map;

let arr = ['first', 'second', 'third'];


/* forEach (async) */
yield forEach(arr, function * (item, index) {
	// item is value, e.g. 'first'
	// index is, well, index, e.g. 0
});


/* forEachSeries (serially) */
yield forEachSeries(arr, function * (item, index) {
  // same as forEach()
});

/* filter */
let result = yield filter(arr, function * (item, index) {
	// return true or false
});


/* map */
let result = yield map(arr, function * (item, index) {
	// return value
});
```


### Tests

[![Circle CI](https://circleci.com/gh/vdemedes/array-generators.svg?style=svg)](https://circleci.com/gh/vdemedes/array-generators)

```
$ make test
```


### License

MIT © [Vadym Demedes](http://vadimdemedes.com)

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