{"_id":"@putout/plugin-generators","_rev":"4159882","name":"@putout/plugin-generators","description":"🐊Putout plugin improves code related to generators","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"time":{"modified":"2026-03-01T20:36:42.000Z","created":"2024-05-10T10:25:27.277Z","2.0.0":"2025-05-31T21:20:24.585Z","1.0.0":"2024-05-10T10:25:27.277Z"},"users":{},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"versions":{"2.0.0":{"name":"@putout/plugin-generators","version":"2.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin improves code related to generators","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-generators#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"fullstore":"^3.0.0"},"keywords":["putout","putout-plugin","plugin","esm","commonjs"],"devDependencies":{"@putout/eslint-flat":"^3.0.0","@putout/test":"^13.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^27.0.0","madrun":"^11.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=40"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-generators@2.0.0","gitHead":"0bcb30a5094cd342eff83b0158826553a86ec988","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"20.19.0","_npmVersion":"11.1.0","dist":{"shasum":"6508b80915962703b8298eafd58a59a330156c2e","size":2755,"noattachment":false,"key":"/@putout/plugin-generators/-/@putout/plugin-generators-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-generators/download/@putout/plugin-generators-2.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-generators_2.0.0_1748726424421_0.26769800920513576"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-31T21:20:24.585Z","publish_time":1748726424585,"_source_registry_name":"default","_cnpm_publish_time":1748726424585},"1.0.0":{"name":"@putout/plugin-generators","version":"1.0.0","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin improves code related to generators","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-generators#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{"fullstore":"^3.0.0"},"keywords":["putout","putout-plugin","plugin","esm","commonjs"],"devDependencies":{"@putout/test":"^9.0.0","c8":"^9.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^22.0.0","lerna":"^6.0.1","madrun":"^10.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=35"},"license":"MIT","engines":{"node":">=18"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-generators@1.0.0","gitHead":"e674127aa200aa54beb976e9d323bc11d9686750","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"shasum":"cbc4a858e46db14e6ce17d41a73ec6020d3500b9","size":2783,"noattachment":false,"key":"/@putout/plugin-generators/-/@putout/plugin-generators-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-generators/download/@putout/plugin-generators-1.0.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-generators_1.0.0_1715336727126_0.33306897346949804"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-05-10T10:25:27.277Z","publish_time":1715336727277,"_source_registry_name":"default","_cnpm_publish_time":1715336727277}},"readme":"# @putout/plugin-generators [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-generators.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-generators\"npm\"\n\n> The `function*` declaration creates a binding of a new generator function to a given name. A generator function can be exited and later re-entered, with its context (variable bindings) saved across re-entrances.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\n\n????[**Putout**](https://github.com/coderaiser/putout) plugin improves `Generator`-related code.\n\n## Install\n\n```\nnpm i @putout/plugin-generators -D\n```\n\n## Rules\n\n- ✅ [add-missing-star](#add-missing-star);\n- ✅ [convert-multiple-to-generator](#convert-multiply-to-generator);\n\n## Config\n\n```json\n{\n    \"rules\": {\n        \"generators/add-missing-star\": \"on\",\n        \"generators/convert-multiple-to-generator\": \"on\"\n    }\n}\n```\n\n## add-missing-star\n\n> The `function*` declaration creates a binding of a new generator function to a given name.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*)\n\n### ❌ Example of incorrect code\n\n```js\nfunction hello() {\n    yield;\n    'world';\n}\n\nfunction func2() {\n    yield * func1();\n}\n```\n\n### ✅ Example of correct code\n\n```js\nfunction* hello() {\n    yield 'world';\n}\n\nfunction* func2() {\n    yield* func1();\n}\n```\n\n## convert-multiply-to-generator\n\nCheckout in ????[**Putout Editor**](https://putout.cloudcmd.io/#/gist/1c5326b470677a2ab253963fe39971f2/860b7eafb0bdd33ec007e709e7825c47bbc38940).\n\n### ❌ Example of incorrect code\n\n```js\nconst a = 5 * function hello() {};\n```\n\n### ✅ Example of correct code\n\n```js\nconst a = 5;\n\nfunction* hello() {}\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-generators#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"license":"MIT"}