Is this an ES6 generator function?
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.eslintrc Update `tape`, `semver`, `eslint`; use my personal shared `eslint` co… Jul 25, 2015
.gitignore
.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
CHANGELOG.md v1.0.7 Dec 28, 2017
LICENSE
Makefile Forgot to add `replace` in 209fac4 Mar 3, 2015
README.md fix: example code missing ) after argument list Sep 28, 2017
index.js
package.json [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `repl… Dec 18, 2018

README.md

is-generator-function Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

Is this a native generator function?

Example

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

Tests

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