is-generator-function <sup>Version Badge</sup>

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

is-generator-function - Installation

To install is-generator-function via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install is-generator-function --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install is-generator-function

Learn more about the config option.

PNPM

pnpm install is-generator-function --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install is-generator-function --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

is-generator-function - Download

Download Tarball (v1.1.2)

Integrity sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==
SHASUM ae3b61e3d5ea4e4839b90bad22b02335051a17d5
Tarball https://js.registry.sudovanilla.org/is-generator-function/-/is-generator-function-1.1.2.tgz