generated from Java-2025Fall/final-vibevault-template
| .. | ||
| .github | ||
| test | ||
| .eslintrc | ||
| .nycrc | ||
| CHANGELOG.md | ||
| index.d.mts | ||
| index.d.ts | ||
| index.js | ||
| index.mjs | ||
| legacy.js | ||
| LICENSE.md | ||
| package.json | ||
| README.md | ||
| require.mjs | ||
| tsconfig.json | ||
generator-function 
A function that returns the normally hidden GeneratorFunction constructor, when available.
Getting started
npm install --save generator-function
Usage/Examples
const assert = require('assert');
const GeneratorFunction = require('generator-function')();
const fn = new GeneratorFunction('return 1');
assert.equal(fn.toString(), 'function* anonymous(\n) {\nreturn 1\n}');
const iterator = fn();
assert.deepEqual(iterator.next(), { done: true, value: 1 });
Tests
Clone the repo, npm install, and run npm test
