{"_id":"@putout/plugin-apply-cause@1.0.0","tag":false,"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"dist":{"shasum":"e63313b13280fba8824fb07f5db944feccea3d58","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-cause/download/@putout/plugin-apply-cause-1.0.0.tgz","fileCount":4,"integrity":"sha512-krv4fwNnFIIyEqo3aIgGTtF2OZ3chZcucea94FX7ZkmlivJAqHz+APjBiGNF5kR7/xIZSQa3i+nD9ykiwGqZuA==","signatures":[{"sig":"MEUCIQDk+kAQQLxHJ09PzeHl0NoFGc3sWMxoZIWXvlj23UPALwIgb1uhfmEM96nqjskyg3+MF53+A7b0zc5kscGiBHvZhVA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCl9F/FO4Xdsj9s7MXlfKipWROzM0DABhLgSVPouUC0TAIgQizSN7glN6zTUR0jFEQIVN8HWZ18fzfIjcWnsJ0imKA="}],"unpackedSize":4075,"size":2089,"noattachment":false,"key":"/@putout/plugin-apply-cause/-/@putout/plugin-apply-cause-1.0.0.tgz"},"main":"lib/apply-cause.js","name":"@putout/plugin-apply-cause","type":"module","author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"engines":{"node":">=22"},"gitHead":"f6bcde5f674c06ff3ec4795ff80e0091ee0ad722","license":"MIT","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","wcausech:test":"madrun wcausech:test"},"version":"1.0.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-cause#readme","keywords":["putout","putout-plugin","plugin","cause"],"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"12.0.2","description":"🐊Putout plugin adds ability to apply 'cause'","directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_nodeVersion":"26.13.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.0.0","madrun":"^13.0.0","nodemon":"^3.0.1","superc8":"^12.0.0","@putout/test":"^15.0.0","@putout/eslint-flat":"^4.0.0","eslint-plugin-putout":"^31.0.0"},"peerDependencies":{"putout":">=42"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-apply-cause_1.0.0_1793223276723_0.41109459277652816"},"readme":"# @putout/plugin-apply-cause [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-cause.svg?style=flcause&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-cause \"npm\"\n\n> The `cause` data property of an Error instance indicates the specific original cause of the error.:\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply `cause`\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/7f13036172975d7b27cf371a9fbb5e8c/4db40fe32bfdc4f8475692ba139608298f15605f).\n\n## Install\n\n```\nnpm i @putout/plugin-apply-cause\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-cause\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\ntry {} catch(error) {\n    if (controller.signal.aborted)\n        throw Error('timeout');\n}\n```\n\n## ✅ Example of correct code\n\n```js\ntry {} catch(error) {\n    if (controller.signal.aborted)\n        throw Error('timeout', {\n            cause: error,\n        });\n}\n```\n\n## License\n\nMIT\n","publish_time":1793223276806,"_cnpm_publish_time":1793223276806,"dist-tags":{"latest":"1.0.0"}}