{"name":"@putout/plugin-apply-try-catch","version":"1.0.0","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"putout plugin adds ability apply try-catch","homepage":"http://github.com/coderaiser/putout","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":{},"keywords":["putout","putout-plugin","putout-plugin-apply","plugin","try-catch"],"devDependencies":{"@putout/test":"^3.0.0","c8":"^7.5.0","eslint":"^7.0.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^8.0.0","lerna":"^4.0.0","madrun":"^8.0.1","nodemon":"^2.0.1"},"peerDependencies":{"putout":">=18"},"license":"MIT","engines":{"node":">=14"},"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-apply-try-catch@1.0.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-esKxrd5cSod0voOfcQHtSmNK/a+pw6wF2mA+WZVEX0zuNzKdXOoiE09yFIIE1Boxc4sj3rHvrC/Qp8RakRZH4g==","shasum":"8457412717e17f0e9f38df45a8bccd2f0a6d7853","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-try-catch/download/@putout/plugin-apply-try-catch-1.0.0.tgz","fileCount":7,"unpackedSize":6304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAa6ICRA9TVsSAnZWagAAOzkP/1Qp7aMVDPItqlH7FpL7\nDmXr3TaulRKY4uchmCGVPWJqB/LygKGnl1QteZ4wW922sIjrKZMJwrZzZx7Q\nxWpkJ22w/eLo9G3ZyQOReu7ijxZBAWLpG9IO0i0Je1jTJchpMW4b4eNSE2Pg\nkU7xs1hfVqhmMm4n/+0/aBoCBVCfO5+BGu+aGrR+iVR6TWNH1ypvnSK9oOJv\nk4SUoGuoXAzlxLuctSS2WcG6hTrA/7OTWaYAORgqgbEIb24Fu+7Olq8pifiH\n45aiuNlv/WfImiLoX2gzUMfEPptFLSvoI+QSgczRjusfrG9qw/aL9zK77V7N\nYeJpM1GbzfNI0CzecQLBwUYL1VmVGgOyI+ocFam9tPoV1DsVOoE+agpSFy+Q\nYztcpDe8MpEFtBGOjhLZ+bkBhluPPCnHLxIJzbY8keGf6R+sPtCTVLKugnbV\n9wAMiNm/bw0jB3Qn25Z5wg1j+R3vDGil41Xn4F15QkicRwZR34eanxkYiSRh\nonWQd+vbdo1dq5wCe0lB+1nxVQUIqNJBx0PkO0NfY5ZdPhXDHm552FIgtDnD\nHooFyGzS3aTgWn54Fe0H1r7FGbDxrQRVkyzsfoCDWdn3J2OUwPMSSsBZw4Jc\n69Rde+b7NVQXUVFwCBf3DK1lOL/nJS8dFZNcmxuN/NOoiayNiOqGeMejAVZs\nmHFN\r\n=EQ6/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDefKycx6M2p90MW+UbQwZ44sZOlI1ut5AaG5wQXbGfsAiBFqgvaHdOmMdtc9JTauDOPnxOb2Ci4G2bIW2+wNC7hQw=="}],"size":2521,"noattachment":false,"key":"/@putout/plugin-apply-try-catch/-/@putout/plugin-apply-try-catch-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-apply-try-catch_1.0.0_1627500168259_0.7998357588948075"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-apply-try-catch [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-try-catch.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-try-catch \"npm\"\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply [tryCatch](https://github.com/coderaiser/try-catch) and [tryToCatch](https://github.com/coderaiser/try-to-catch). Renamed to [`@putout/plugin-try-catch`](https://www.npmjs.com/package/@putout/plugin-try-catch).\n\n## Install\n\n```\nnpm i @putout/plugin-apply-try-catch\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-try-catch/await\": \"on\",\n        \"apply-try-catch/args\": \"on\",\n        \"apply-try-catch/declare\": \"on\",\n        \"apply-try-catch/expand-arguments\": \"on\",\n        \"apply-try-catch/try-catch\": \"on\",\n        \"apply-try-catch/try-to-catch\": \"on\"\n    }\n}\n```\n\n## try-catch\n\n### ❌ Example of incorrect code\n\n```js\ntry {\n    log('hello');\n} catch(error) {\n}\n```\n\n### ✅ Example of correct code\n\n```js\nimport tryCatch from 'try-catch';\nconst [error] = tryCatch(log, 'hello');\n```\n\n## try-to-catch\n\n### ❌ Example of incorrect code\n\n```js\ntry {\n    await send('hello');\n} catch(error) {\n}\n```\n\n### ✅ Example of correct code\n\n```js\nimport tryToCatch from 'try-catch';\nconst [error] = await tryToCatch(send, 'hello');\n```\n\n## await\n\n### ❌ Example of incorrect code\n\n```js\nawait tryCatch(a, b);\ntryToCatch(a, b);\n```\n\n### ✅ Example of correct code\n\n```js\nawait tryToCatch(a, b);\n```\n\n## args\n\n### ❌ Example of incorrect code\n\n```js\ntryCatch(send('hello'));\n```\n\n### ✅ Example of correct code\n\n```js\ntryCatch(send, 'hello');\n```\n\n## declare\n\n### ❌ Example of incorrect code\n\n```js\nconst [error] = tryCatch(fs.readFileSync, 'hello.txt');\n```\n\n### ✅ Example of correct code\n\n```js\nimport tryCatch from 'try-catch';\nconst [error] = tryCatch(fs.readFileSync, 'hello.txt');\n```\n\n## expand-arguments\n\n### ❌ Example of incorrect code\n\n```js\nimport tryCatch from 'try-catch';\n\ntest('some message', (t) => {\n    const fn = () => copymitter('/hello');\n    const [error] = tryCatch(fn);\n    \n    t.equal(error.message, 'to should be a string!');\n    t.end();\n});\n```\n\n### ✅ Example of correct code\n\n```js\nimport tryCatch from 'try-catch';\n\ntest('some message', (t) => {\n    const [error] = tryCatch(copymitter, '/hello');\n    \n    t.equal(error.message, 'to should be a string!');\n    t.end();\n});\n```\n\n## License\n\nMIT\n","publish_time":1627500168454,"_cnpm_publish_time":1627500168454,"dist-tags":{"latest":"2.8.1"}}