{"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":{"integrity":"sha512-5rETQ4xphQ3pH20AtoW9hn/jmTsVMS/8Sw0Uz0sa2cmSBRx/Nl9777ltrRx+dFZ1jj0f59uCT9mnHIe31Th44w==","shasum":"cbc4a858e46db14e6ce17d41a73ec6020d3500b9","tarball":"http://registry-npm.ywwl.com/@putout/plugin-generators/download/@putout/plugin-generators-1.0.0.tgz","fileCount":6,"unpackedSize":6470,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDNRMBQbjelz3Yb8UltTdgITWJShuQ7lE5SOASzIm1mgIgJzBPlbQaF0g0r9aUadHBOWDNSscO2WwvLcvKJFI++aM="}],"size":2783,"noattachment":false,"key":"/@putout/plugin-generators/-/@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,"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","publish_time":1715336727277,"_cnpm_publish_time":1715336727277,"dist-tags":{"latest":"2.0.0"}}