{"id":15713324,"url":"https://github.com/timothygu/generator-function","last_synced_at":"2025-07-30T17:34:57.774Z","repository":{"id":57247235,"uuid":"44040641","full_name":"TimothyGu/generator-function","owner":"TimothyGu","description":"Expose the GeneratorFunction constructor if supported by the runtime","archived":false,"fork":false,"pushed_at":"2015-10-12T06:58:00.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-14T05:03:36.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimothyGu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-11T05:35:51.000Z","updated_at":"2015-10-11T05:36:31.000Z","dependencies_parsed_at":"2022-08-24T16:50:47.463Z","dependency_job_id":null,"html_url":"https://github.com/TimothyGu/generator-function","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TimothyGu/generator-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyGu%2Fgenerator-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyGu%2Fgenerator-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyGu%2Fgenerator-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyGu%2Fgenerator-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimothyGu","download_url":"https://codeload.github.com/TimothyGu/generator-function/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyGu%2Fgenerator-function/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267911567,"owners_count":24164462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:22:16.983Z","updated_at":"2025-07-30T17:34:57.674Z","avatar_url":"https://github.com/TimothyGu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generator-function\n\nExpose the ES2015 `GeneratorFunction` constructor.\n\n[![Build Status](https://img.shields.io/travis/TimothyGu/generator-function/master.svg)](https://travis-ci.org/TimothyGu/generator-function)\n[![Dependency Status](https://img.shields.io/david/TimothyGu/generator-function.svg)](https://david-dm.org/TimothyGu/generator-function)\n[![devDependency Status](https://img.shields.io/david/dev/TimothyGu/generator-function.svg)](https://david-dm.org/TimothyGu/generator-function#info=devDependencies)\n[![npm version](https://img.shields.io/npm/v/generator-function.svg)](https://www.npmjs.org/package/generator-function)\n\n## Installation\n\n    npm install generator-function\n\n## Description\n\nLike `Function`s, one could create generator functions from a JavaScript string\nthrough a special constructor called `GeneratorFunction`. However, the\nconstructor function is [not available as a global][mdn], so one has to use the\n`constructor` property of an existing generator function.\n\nThis module makes it easy to do so, and falls back gracefully when a runtime\nnot supporting generator functions is encountered.\n\n[mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction#Summary\n\n\n## Usage\n\nOn a platform supporting generator functions:\n\n```js\nvar GeneratorFunction = require('generator-function')\n\nvar generatorFunction = new GeneratorFunction('arg1', 'yield arg1')\nvar generator = generatorFunction(1)\n\ngenerator.next()\n//=\u003e { value: 1, done: false }\ngenerator.next()\n//=\u003e { value: undefined, done: true }\n```\n\nOn a runtime that does not support them:\n\n```js\nvar GeneratorFunction = require('generator-function')\n\nGeneratorFunction\n// =\u003e undefined\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothygu%2Fgenerator-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothygu%2Fgenerator-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothygu%2Fgenerator-function/lists"}