is-generator-fn (2.1.0)

Published 2026-02-24 13:58:26 +00:00 by atheaadmin

Installation

registry=
npm install is-generator-fn@2.1.0
"is-generator-fn": "2.1.0"

About this package

is-generator-fn Build Status

Check if something is a generator function

Install

$ npm install is-generator-fn

Usage

const isGeneratorFn = require('is-generator-fn');

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

isGeneratorFn(function () {});
//=> false
  • is - Type check values

License

MIT © Sindre Sorhus

Dependencies

Development Dependencies

ID Version
ava ^1.4.1
tsd ^0.7.2
xo ^0.24.0

Keywords

generator function func fn is check detect yield type
Details
npm
2026-02-24 13:58:26 +00:00
1
Sindre Sorhus
MIT
latest
1.7 KiB
Assets (1)
Versions (1) View all
2.1.0 2026-02-24