{
  "_id": "generator-function",
  "maintainers": [
    {
      "name": "timothygu",
      "email": "timothygu99@gmail.com"
    },
    {
      "name": "ljharb",
      "email": "ljharb@gmail.com"
    }
  ],
  "keywords": [
    "generator",
    "function",
    "native"
  ],
  "dist-tags": {
    "latest": "2.0.1"
  },
  "author": {
    "name": "Jordan Harbamd",
    "email": "ljharb@gmail.com"
  },
  "_rev": "7-83b8e96f4cb9c03cce4daeaf8976bd9d",
  "description": "A function that returns the normally hidden `GeneratorFunction` constructor",
  "readme": "# generator-function <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nA function that returns the normally hidden `GeneratorFunction` constructor, when available.\n\n## Getting started\n\n```sh\nnpm install --save generator-function\n```\n\n## Usage/Examples\n\n```js\nconst assert = require('assert');\nconst GeneratorFunction = require('generator-function')();\n\nconst fn = new GeneratorFunction('return 1');\n\nassert.equal(fn.toString(), 'function* anonymous(\\n) {\\nreturn 1\\n}');\n\nconst iterator = fn();\n\nassert.deepEqual(iterator.next(), { done: true, value: 1 });\n```\n\n## Tests\n\nClone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/generator-function\n[npm-version-svg]: https://versionbadg.es/TimothyGu/generator-function.svg\n[deps-svg]: https://david-dm.org/TimothyGu/generator-function.svg\n[deps-url]: https://david-dm.org/TimothyGu/generator-function\n[dev-deps-svg]: https://david-dm.org/TimothyGu/generator-function/dev-status.svg\n[dev-deps-url]: https://david-dm.org/TimothyGu/generator-function#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/generator-function.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/generator-function.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/generator-function.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=generator-function\n[codecov-image]: https://codecov.io/gh/TimothyGu/generator-function/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/TimothyGu/generator-function/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/TimothyGu/generator-function\n[actions-url]: https://github.com/TimothyGu/generator-function/actions\n",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/TimothyGu/generator-function.git"
  },
  "bugs": {
    "url": "https://github.com/TimothyGu/generator-function/issues"
  },
  "license": "MIT",
  "versions": {
    "1.0.0": {
      "name": "generator-function",
      "version": "1.0.0",
      "keywords": [
        "generators"
      ],
      "author": {
        "name": "Timothy Gu",
        "email": "timothygu99@gmail.com"
      },
      "license": "MIT",
      "_id": "generator-function@1.0.0",
      "maintainers": [
        {
          "name": "timothygu",
          "email": "timothygu99@gmail.com"
        }
      ],
      "homepage": "https://github.com/timothygu/generator-function#readme",
      "bugs": {
        "url": "https://github.com/timothygu/generator-function/issues"
      },
      "dist": {
        "shasum": "931e79b57b0544c7e0417e65c3764c90d8c8c25d",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/generator-function/-/generator-function-1.0.0.tgz",
        "integrity": "sha512-sMG5cThTMmmKyxx7Vob3Yuy4HqiqL8D8+ZeQToy45FXpI5CA41akXb1zuDHp5n7FDwdWPDX3IWznCAYJAgk9MA==",
        "signatures": [
          {
            "sig": "MEUCIGOypTouA42oBtJi7l9DQE2jkz4HAQHr4Tj8uf7ISgIJAiEAziH+uwVNe/iptnUYDgAwmbjdIlfPtH3B5hQ/zYgUN4A=",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ]
      },
      "main": "index.js",
      "_from": ".",
      "_shasum": "931e79b57b0544c7e0417e65c3764c90d8c8c25d",
      "gitHead": "176e0cd3a5ebb004aa666c6eecbe5a968efbddf9",
      "scripts": {
        "test": "node test"
      },
      "_npmUser": {
        "name": "timothygu",
        "email": "timothygu99@gmail.com"
      },
      "repository": {
        "url": "git+https://github.com/timothygu/generator-function.git",
        "type": "git"
      },
      "_npmVersion": "2.14.4",
      "description": "Expose the GeneratorFunction constructor if supported by the runtime",
      "directories": {},
      "_nodeVersion": "4.1.2",
      "devDependencies": {
        "testit": "^2.0.2"
      }
    },
    "2.0.0": {
      "name": "generator-function",
      "version": "2.0.0",
      "keywords": [
        "generator",
        "function",
        "native"
      ],
      "author": {
        "name": "Jordan Harbamd",
        "email": "ljharb@gmail.com"
      },
      "license": "MIT",
      "_id": "generator-function@2.0.0",
      "maintainers": [
        {
          "name": "timothygu",
          "email": "timothygu99@gmail.com"
        },
        {
          "name": "ljharb",
          "email": "ljharb@gmail.com"
        }
      ],
      "homepage": "https://github.com/ljharb/generator-function#readme",
      "bugs": {
        "url": "https://github.com/ljharb/generator-function/issues"
      },
      "dist": {
        "shasum": "f7d330dccf367a666195948580655946d1a3860a",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/generator-function/-/generator-function-2.0.0.tgz",
        "fileCount": 15,
        "integrity": "sha512-xPypGGincdfyl/AiSGa7GjXLkvld9V7GjZlowup9SHIJnQnHLFiLODCd/DqKOp0PBagbHJ68r1KJI9Mut7m4sA==",
        "signatures": [
          {
            "sig": "MEUCIB4l9v/L1mRCI0I9SRqM65hKRzVILXkShm6bBq25DvnhAiEAxHftn0DDN2uc4kR19Cw7Cvxm3/3xryGX/dfRWecbsPo=",
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
          }
        ],
        "unpackedSize": 9798
      },
      "main": "./legacy.js",
      "module": "./index.mjs",
      "engines": {
        "node": ">= 0.4"
      },
      "exports": {
        ".": [
          {
            "import": "./index.mjs",
            "default": "./index.js",
            "module-sync": "./require.mjs"
          },
          "./index.js"
        ],
        "./package.json": "./package.json"
      },
      "gitHead": "2695e9c2e0a4529d5f8fc2f1f2c8fb112e325e34",
      "scripts": {
        "lint": "eslint --ext=js,mjs .",
        "test": "npm run tests-only",
        "prelint": "evalmd README.md",
        "prepack": "npmignore --auto --commentLines=autogenerated",
        "pretest": "npm run --silent lint",
        "version": "auto-changelog && git add CHANGELOG.md",
        "postlint": "tsc && attw -P",
        "posttest": "npx npm@\">=10.2\" audit --production",
        "prepublish": "not-in-publish || npm run prepublishOnly",
        "tests-only": "nyc tape 'test/**/*.js'",
        "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
        "prepublishOnly": "safe-publish-latest"
      },
      "_npmUser": {
        "name": "ljharb",
        "email": "ljharb@gmail.com"
      },
      "testling": {
        "files": "test/index.js"
      },
      "repository": {
        "url": "git+https://github.com/ljharb/generator-function.git",
        "type": "git"
      },
      "_npmVersion": "11.6.0",
      "description": "A function that returns the normally hidden `GeneratorFunction` constructor",
      "directories": {},
      "jsnext:main": "./index.mjs",
      "sideEffects": false,
      "_nodeVersion": "24.8.0",
      "publishConfig": {
        "ignore": [
          ".github/workflows"
        ]
      },
      "_hasShrinkwrap": false,
      "auto-changelog": {
        "output": "CHANGELOG.md",
        "template": "keepachangelog",
        "hideCredit": true,
        "unreleased": false,
        "commitLimit": false,
        "backfillLimit": false
      },
      "devDependencies": {
        "nyc": "^10.3.2",
        "tape": "^5.9.0",
        "eslint": "=8.8.0",
        "evalmd": "^0.0.19",
        "semver": "^6.3.1",
        "encoding": "^0.1.13",
        "get-proto": "^1.0.1",
        "npmignore": "^0.3.1",
        "in-publish": "^2.0.1",
        "typescript": "next",
        "@types/tape": "^5.8.1",
        "@types/semver": "^6.2.7",
        "auto-changelog": "^2.5.0",
        "@ljharb/tsconfig": "^0.3.2",
        "generator-function": "file:.",
        "safe-publish-latest": "^2.0.0",
        "@arethetypeswrong/cli": "^0.18.2",
        "@ljharb/eslint-config": "^21.2.0"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/generator-function_2.0.0_1759159757498_0.84355731237888",
        "host": "s3://npm-registry-packages-npm-production"
      }
    },
    "2.0.1": {
      "name": "generator-function",
      "version": "2.0.1",
      "description": "A function that returns the normally hidden `GeneratorFunction` constructor",
      "main": "./legacy.js",
      "jsnext:main": "./index.mjs",
      "module": "./index.mjs",
      "exports": {
        ".": [
          {
            "module-sync": "./require.mjs",
            "import": "./index.mjs",
            "default": "./index.js"
          },
          "./index.js"
        ],
        "./package.json": "./package.json"
      },
      "sideEffects": false,
      "scripts": {
        "prepack": "npmignore --auto --commentLines=autogenerated",
        "prepublish": "not-in-publish || npm run prepublishOnly",
        "prepublishOnly": "safe-publish-latest",
        "pretest": "npm run --silent lint",
        "test": "npm run tests-only",
        "posttest": "npx npm@\">=10.2\" audit --production",
        "tests-only": "nyc tape 'test/**/*.js'",
        "prelint": "evalmd README.md",
        "lint": "eslint --ext=js,mjs .",
        "postlint": "tsc && attw -P",
        "version": "auto-changelog && git add CHANGELOG.md",
        "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/TimothyGu/generator-function.git"
      },
      "keywords": [
        "generator",
        "function",
        "native"
      ],
      "author": {
        "name": "Jordan Harbamd",
        "email": "ljharb@gmail.com"
      },
      "license": "MIT",
      "bugs": {
        "url": "https://github.com/TimothyGu/generator-function/issues"
      },
      "homepage": "https://github.com/TimothyGu/generator-function#readme",
      "devDependencies": {
        "@arethetypeswrong/cli": "^0.18.2",
        "@ljharb/eslint-config": "^21.2.0",
        "@ljharb/tsconfig": "^0.3.2",
        "@types/semver": "^6.2.7",
        "@types/tape": "^5.8.1",
        "auto-changelog": "^2.5.0",
        "encoding": "^0.1.13",
        "eslint": "=8.8.0",
        "evalmd": "^0.0.19",
        "generator-function": "file:.",
        "get-proto": "^1.0.1",
        "in-publish": "^2.0.1",
        "npmignore": "^0.3.1",
        "nyc": "^10.3.2",
        "safe-publish-latest": "^2.0.0",
        "semver": "^6.3.1",
        "tape": "^5.9.0",
        "typescript": "next"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "auto-changelog": {
        "output": "CHANGELOG.md",
        "template": "keepachangelog",
        "unreleased": false,
        "commitLimit": false,
        "backfillLimit": false,
        "hideCredit": true
      },
      "publishConfig": {
        "ignore": [
          ".github/workflows"
        ]
      },
      "testling": {
        "files": "test/index.js"
      },
      "_id": "generator-function@2.0.1",
      "gitHead": "e44c753dc1205a5a1cd45176acbcd139c8d68a7b",
      "_nodeVersion": "24.8.0",
      "_npmVersion": "11.6.0",
      "dist": {
        "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==",
        "shasum": "0e75dd410d1243687a0ba2e951b94eedb8f737a2",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/generator-function/-/generator-function-2.0.1.tgz",
        "fileCount": 15,
        "unpackedSize": 10078,
        "signatures": [
          {
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
            "sig": "MEYCIQCXvvD7eYZVwiqloP0XuYvCf15pOlzD4om/uARrTkraRQIhALPOBMSfK3qfc1T4rH9cchnxChzVenD8zuOI2lRbp7wt"
          }
        ]
      },
      "_npmUser": {
        "name": "ljharb",
        "email": "ljharb@gmail.com"
      },
      "directories": {},
      "maintainers": [
        {
          "name": "timothygu",
          "email": "timothygu99@gmail.com"
        },
        {
          "name": "ljharb",
          "email": "ljharb@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages-npm-production",
        "tmp": "tmp/generator-function_2.0.1_1759256613000_0.7235255081930327"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "generator-function",
  "time": {
    "created": "2015-10-11T05:37:08.176Z",
    "modified": "2026-05-13T07:02:23.229Z",
    "1.0.0": "2015-10-11T05:37:08.176Z",
    "2.0.0": "2025-09-29T15:29:17.691Z",
    "2.0.1": "2025-09-30T18:23:33.207Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/TimothyGu/generator-function#readme"
}