is-generator-function
Determine if a function is an ES6 generator function or not.
Last updated 11 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-generator-function 
SYNC missed versions from official npm registry.

is-generator-function Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

Current Tags

  • 1.0.4                                ...           backport (9 years ago)
  • 1.1.2                                ...           latest (6 months ago)

14 Versions

  • 1.1.2                                ...           6 months ago
  • 1.1.1                                ...           6 months ago
  • 1.1.0                                ...           a year ago
  • 1.0.10                                ...           5 years ago
  • 1.0.9                                ...           5 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.7                                ...           8 years ago
  • 1.0.6                                ...           9 years ago
  • 1.0.4                                ...           9 years ago
  • 1.0.5 [deprecated]           ...           9 years ago
  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 38
This Month 68
Last Day 2
Last Week 39
Last Month 72
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |