# is-generator-fn

> Check if something is a generator function

Latest version **3.0.0** (published 2021-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-generator-fn
pnpm add is-generator-fn
yarn add is-generator-fn
bun add is-generator-fn
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-08-11 |
| First published | 2015-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | generator, function, func, fn, is, check, detect, yield, type |

## Links

- npm: https://www.npmjs.com/package/is-generator-fn
- Repository: https://github.com/sindresorhus/is-generator-fn
- Homepage: https://github.com/sindresorhus/is-generator-fn#readme
- Issues: https://github.com/sindresorhus/is-generator-fn/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-generator-fn

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-08-11
- 2.1.0 — 2019-04-06
- 2.0.0 — 2018-12-29
- 1.0.0 — 2015-11-15

## README

# is-generator-fn

> Check if something is a [generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*)

## Install

```
$ npm install is-generator-fn
```

## Usage

```js
import isGeneratorFunction from 'is-generator-fn';

isGeneratorFunction(function * () {});
//=> true

isGeneratorFunction(function () {});
//=> false
```

## Related

- [is](https://github.com/sindresorhus/is) - Type check values

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