# gens

> Experimental usage of generators for continuables

Latest version **1.1.0** (published 2014-07-17) · 0 weekly downloads

## Install

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

## 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 | 2014-07-17 |
| First published | 2013-06-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Raynos |
| Maintainers | raynos |

## Links

- npm: https://www.npmjs.com/package/gens
- Repository: https://github.com/Raynos/gens
- Issues: https://github.com/Raynos/gens/issues
- npm.io page: https://npm.io/package/gens

## Dependencies (2)

- [bluebird](https://npm.io/package/bluebird.md) ^2.2.2
- [continuable-para](https://npm.io/package/continuable-para.md) ~1.0.2

## Recent versions

- 1.1.0 (latest) — 2014-07-17
- 1.0.2 — 2013-11-27
- 1.0.1 — 2013-11-27
- 0.4.4 — 2013-11-02
- 0.4.3 — 2013-10-31
- 0.4.1 — 2013-09-30
- 0.2.5 — 2013-07-27
- 0.2.4 — 2013-07-07
- 0.2.2 — 2013-06-12
- 0.2.1 — 2013-06-12

## README

# gens

<!-- [![browser support][5]][6] -->

[![build status][1]][2] [![NPM version][7]][8] [![dependency status][3]][4]

Experimental usage of generators for continuables

`async` takes a generator and returns a continuable. It's expected that
    the values you yield are continuables themself.

## Example

```js
// run this with --use-strict --harmony on node v0.11.3
let Redis = require("redis")
let console = require("console")
let async = require("gens")
let parallel = require("gens/parallel")

let client = Redis.createClient()

async(function* () {
    yield client.hmset.bind(client, "blog::post", {
        date: "20130605",
        title: "g3n3rat0rs r0ck",
        tags: "js,node"
    })

    let post = yield client.hgetall.bind(client, "blog::post")
    let tags = post.tags.split(",")
    let taggedPosts = yield parallel(tags.map(function (tag) {
        return client.hgetall.bind(client, "post::tag::" + tag)
    }))

    return { post: post, taggedPosts: taggedPosts }
})(function (err, result) {
    if (err) {
        throw err
    }

    console.log("post", result.post, "taggedPosts", result.taggedPosts)

    client.quit()
})
```

## Installation

`npm install gens`

## Contributors

 - Raynos

## MIT Licenced

  [1]: https://secure.travis-ci.org/Raynos/gens.png
  [2]: https://travis-ci.org/Raynos/gens
  [3]: https://david-dm.org/Raynos/gens.png
  [4]: https://david-dm.org/Raynos/gens
  [5]: https://ci.testling.com/Raynos/gens.png
  [6]: https://ci.testling.com/Raynos/gens
  [7]: https://badge.fury.io/js/gens.png
  [8]: https://badge.fury.io/js/gens

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