{"_id":"@putout/plugin-convert-throw","_rev":"4155198","name":"@putout/plugin-convert-throw","description":"🐊Putout plugin adds ability to convert throw statement into throw expression","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"time":{"modified":"2026-03-01T20:23:42.000Z","created":"2020-01-21T18:44:33.224Z","2.0.0":"2026-01-28T12:17:45.379Z","1.0.1":"2020-01-21T19:15:40.838Z","1.0.0":"2020-01-21T18:44:33.224Z"},"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-convert-throw","version":"2.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability to convert throw statement into throw expression","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-throw#readme","main":"lib/convert-throw.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":{},"keywords":["putout","putout-plugin","plugin","convert","throw"],"devDependencies":{"@babel/core":"^8.0.0-alpha.1","@babel/eslint-parser":"^8.0.0-alpha.1","@babel/plugin-proposal-throw-expressions":"^8.0.0-alpha.1","@putout/eslint-flat":"^4.0.0","@putout/test":"^15.0.0","c8":"^10.0.0","eslint":"^10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^30.0.0","madrun":"^12.0.0"},"peerDependencies":{"putout":">=41"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-convert-throw@2.0.0","gitHead":"c81ceae32c6d205adfe4253e2eab231bcd4fe5bc","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.4.0","_npmVersion":"11.4.2","dist":{"shasum":"d142a0d1e3e8c03dc62affd84b2a312abc4a3b71","size":1867,"noattachment":false,"key":"/@putout/plugin-convert-throw/-/@putout/plugin-convert-throw-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-convert-throw/download/@putout/plugin-convert-throw-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-convert-throw_2.0.0_1769602665236_0.5670336726931529"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-28T12:17:45.379Z","publish_time":1769602665379,"_source_registry_name":"default","_cnpm_publish_time":1769602665379},"1.0.1":{"name":"@putout/plugin-convert-throw","version":"1.0.1","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout plugin adds ability to convert throw statement into throw expression","homepage":"http://github.com/coderaiser/putout","main":"lib/convert-throw.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","lint":"madrun lint","fix:lint":"madrun fix:lint","coverage":"madrun coverage"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","convert","throw"],"devDependencies":{"@putout/test":"^1.3.0","coveralls":"^3.0.0","eslint":"^6.2.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^3.0.0","madrun":"^5.0.0","nyc":"^14.0.0","supertape":"^1.0.3"},"peerDependencies":{"putout":">=7.7"},"license":"MIT","engines":{"node":">=8.3.0"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-convert-throw@1.0.1","_nodeVersion":"13.7.0","_npmVersion":"6.12.1","dist":{"shasum":"9f3c4a65a5a36511abeda570cdd2ea81d8d250f0","size":1720,"noattachment":false,"key":"/@putout/plugin-convert-throw/-/@putout/plugin-convert-throw-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-convert-throw/download/@putout/plugin-convert-throw-1.0.1.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-convert-throw_1.0.1_1579634140600_0.2513057287772522"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T13:54:10.105Z","publish_time":1579634140838,"_cnpm_publish_time":1579634140838},"1.0.0":{"name":"@putout/plugin-convert-throw","version":"1.0.0","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout plugin adds ability to convert throw statement into throw expression","homepage":"http://github.com/coderaiser/putout","main":"lib/convert-throw.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","lint":"madrun lint","fix:lint":"madrun fix:lint","coverage":"madrun coverage"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","convert","throw"],"devDependencies":{"@putout/test":"^1.3.0","coveralls":"^3.0.0","eslint":"^6.2.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^3.0.0","madrun":"^5.0.0","nyc":"^14.0.0","supertape":"^1.0.3"},"peerDependencies":{"putout":">=7.7"},"license":"MIT","engines":{"node":">=8.3.0"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-convert-throw@1.0.0","_nodeVersion":"13.7.0","_npmVersion":"6.12.1","dist":{"shasum":"f91230ae8040078309a871b3c3816b052279151a","size":1718,"noattachment":false,"key":"/@putout/plugin-convert-throw/-/@putout/plugin-convert-throw-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-convert-throw/download/@putout/plugin-convert-throw-1.0.0.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-convert-throw_1.0.0_1579632273131_0.47047260230979093"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T13:54:09.212Z","publish_time":1579632273224,"_cnpm_publish_time":1579632273224}},"readme":"# @putout/plugin-convert-throw [![NPM version][NPMIMGURL]][NPMURL]\n\n> This proposal defines new syntax to **throw** exceptions from within an expression context.\n>\n> (c) [tc39](https://github.com/tc39/proposal-throw-expressions#status)\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-throw.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-throw \"npm\"\n\n????[**Putout**](https://github.com/coderaiser/putout) plugin adds ability convert **throw** statement to expression.\n\n## Install\n\n```\nnpm i @putout/plugin-convert-throw -D\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"convert-throw\": \"on\"\n    },\n    \"plugins\": [\n        \"convert-throw\"\n    ]\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nconst fn = () => {\n    throw Error('hello');\n};\n```\n\n## ✅ Example of correct code\n\n```js\nconst fn = () => throwError('hello');\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-throw#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"license":"MIT"}