aboutsummaryrefslogtreecommitdiff
path: root/node_modules/is-generator-fn/readme.md
blob: 654c2afd00f673f244db8f1691e90002d867c41b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# is-generator-fn [![Build Status](https://travis-ci.org/sindresorhus/is-generator-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/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
const isGeneratorFn = require('is-generator-fn');

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

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


## Related

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


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)