# auto-yield

> Automatically add yields and generators.

Latest version **0.2.3** (published 2016-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install auto-yield
pnpm add auto-yield
yarn add auto-yield
bun add auto-yield
```

## 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.2.3 |
| Published | 2016-03-29 |
| First published | 2016-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | joshrtay |

## Links

- npm: https://www.npmjs.com/package/auto-yield
- Repository: https://github.com/joshrtay/auto-yield
- Homepage: https://github.com/joshrtay/auto-yield#readme
- Issues: https://github.com/joshrtay/auto-yield/issues
- npm.io page: https://npm.io/package/auto-yield

## Dependencies (2)

- [babel-core](https://npm.io/package/babel-core.md) ^6.7.4
- [camel-case](https://npm.io/package/camel-case.md) ^1.2.2

## Recent versions

- 0.2.3 (latest) — 2016-03-29
- 0.2.2 — 2016-03-28
- 0.2.1 — 2016-03-28
- 0.2.0 — 2016-03-28
- 0.1.3 — 2016-03-25

## README

# auto-yield

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Automatically add yield to generator calls, making asynchronous programming easier for beginners.

## Installation

    $ npm install auto-yield

## Usage

```js
var autoYield = require('auto-yield')

var code = autoYield(`
function main () {
  move()
}

function * move () {
  yield 'moving'
}
`) =>

`function* main() {
yield move();
}

function* move() {
yield 'moving';
}`

```

## API

### autoYield(code, globalGens, secondOrderGens)

- `code` - code to transform
- `globalGens` - array of global names or object names that are generators or have generators
- `secondOrderGens` - array of functions that return generators

**Returns:** transformed code

## License

MIT

[travis-image]: https://img.shields.io/travis/joshrtay/auto-yield.svg?style=flat-square
[travis-url]: https://travis-ci.org/joshrtay/auto-yield
[git-image]: https://img.shields.io/github/tag/joshrtay/auto-yield.svg
[git-url]: https://github.com/joshrtay/auto-yield
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/auto-yield.svg?style=flat-square
[npm-url]: https://npmjs.org/package/auto-yield

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