Is this an ES6 generator function?
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc Update `tape`, `semver`, `eslint`; use my personal shared `eslint` co… Jul 25, 2015
.npmrc [Tests] switch from `nsp` to `npm audit`; allow it to fail for now Dec 18, 2018
.nvmrc Latest `node` now supports generators. Sep 27, 2015
.travis.yml v1.0.7 Dec 28, 2017
Makefile Forgot to add `replace` in 209fac4 Mar 3, 2015 fix: example code missing ) after argument list Sep 28, 2017
package.json [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `repl… Dec 18, 2018

is-generator-function Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

Is this a native generator function?


var isGeneratorFunction = require('is-generator-function');
assert(!isGeneratorFunction(function () {}));
assert(isGeneratorFunction(function* () { yield 42; return Infinity; }));


Simply clone the repo, npm install, and run npm test