# co-dash

> Lodash inspired library for generator functions

Latest version **1.0.71** (published 2017-01-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install co-dash
pnpm add co-dash
yarn add co-dash
bun add co-dash
```

## 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.71 |
| Published | 2017-01-12 |
| First published | 2016-09-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | andrekulpin |
| Maintainers | andrekulpin |
| Keywords | lodash, co, codash, co-dash |

## Links

- npm: https://www.npmjs.com/package/co-dash
- npm.io page: https://npm.io/package/co-dash

## Dependencies (1)

- [bluebird](https://npm.io/package/bluebird.md) ^3.4.6

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

- 1.0.71 (latest) — 2017-01-12
- 1.0.70 — 2016-10-19
- 1.0.69 — 2016-10-10
- 1.0.68 — 2016-10-10
- 1.0.67 — 2016-10-10
- 1.0.66 — 2016-10-10
- 1.0.65 — 2016-10-05
- 1.0.64 — 2016-10-05
- 1.0.63 — 2016-10-03
- 1.0.62 — 2016-10-01
- 1.0.61 — 2016-10-01
- 1.0.6 — 2016-10-01
- 1.0.5 — 2016-10-01
- 1.0.4 — 2016-09-30
- 1.0.3 — 2016-09-30
- … 3 more at https://npm.io/package/co-dash/versions

## README

# co-dash

Lodash-inspired library for generators

## Install

Install the [package](https://npmjs.org/package/co-dash) with [npm](http://npmjs.org):

```sh
$ npm install co-dash
```

## Usage

### `codash.once(fn)`
```js
const co = require('co');
const { once } = require('co-dash');
let getData = once(getData);

co(function*(){
	let data1 = yield getData();
	let data2 = yield getData();
	// result is cached, getData is only called once
})
```

### `codash.filter(arr, fn)`
```js
const co = require('co');
const fs = require('co-fs');
const { filter } = require('co-dash');

co(function*(){
	yield filter(['test1.log','test2.log'], fs.exists);
})
```

### `codash.map(arr, fn)`
```js
const co = require('co');
const fs = require('co-fs');
const { map } = require('co-dash');

co(function*(){
	let files = yield map(['test1.log','test2.log'], fs.readFile);
	//returns [ '...', '...' ]; array of files data
})
```

### `codash.each(arr, fn)`
```js
const co = require('co');
const fs = require('co-fs');
const { each } = require('co-dash');

co(function*(){
	yield each(['test1.log','test2.log'], *function(fileName){
		console.log(yield fs.stat(fileName))
	});
})
```

### `codash.reduce(arr, fn, init)`
```js
const co = require('co');
const fs = require('co-fs');
const { reduce } = require('co-dash');

co(function*(){
	let sum = yield reduce(['test1.log','test2.log'], *function(a, b){
		return a + b
	});
})
```

## License

MIT

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