{"name":"hard-rejection","version":"2.1.0","description":"Make unhandled promise rejections fail hard right away instead of the default silent fail","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/hard-rejection.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","promises","unhandled","uncaught","rejection","hard","fail","catch","throw","handler","exit","debug","debugging","verbose","immediate","immediately"],"devDependencies":{"ava":"^1.4.1","execa":"^1.0.0","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"71300d4b742f2cee0f926f4ad3459b66c88d610f","bugs":{"url":"https://github.com/sindresorhus/hard-rejection/issues"},"homepage":"https://github.com/sindresorhus/hard-rejection#readme","_id":"hard-rejection@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==","shasum":"1c6eda5c1685c63942766d79bb40ae773cecd883","tarball":"http://registry-npm.ywwl.com/hard-rejection/download/hard-rejection-2.1.0.tgz","fileCount":6,"unpackedSize":5142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcoszHCRA9TVsSAnZWagAAX/oP/1rglB8nnb2N698dmy+m\ngo7yTYFFXQNhZruo812YRiNSC05txZHTVkbTny5IboxWH2p/jg/xAAsPlUZ2\na4awtyL7/R+15aJSIJ46fJg0jM8sEbiRV8NyrXN3hPoIKWeMRhUoCIKwVJHj\n7SNJXovwDJ8u1R0ZOmlBoTZtH5Y0dM20UHiVmFoa3RGe3/HPj0fEZVHOW3Wr\ny7cOkpO8UNBU6eoJ77QZjhs0EEU7L08WKk1PwBQxTNAkQP048aPkHZZi48r7\no9SXZYOdohQv/qXC0X2Uze20kn79Jv3Ez/F8acQ3bsGQPdXL/PSuf94yvgHM\nNbZKc0TW/HCq2aLkXN6wZ0hltPl7VPnyKcgi8z5fPGw0NDwCMaIFnvv+cLTF\nfpAxSwG2vHjt3bJYHu2k2Ju3vSAPPTXCzC4oXt1WOEgSaM35XACDhnbmQdfc\n92UUEMQZ5lEAtRyj6C3rXAdWbK5BWEcSGPczhBtcTkdNqUTfW5RZNhWjY2jz\ntUWcm7WtYBuUKCG3aeG/qqzH/i6sjZJqk6y3UeltJ28nkWCApQhomG14EgT/\n2rGgoTiJpW+yEDp3ShTwwm3n2morC8ro7afTrzUc8aItvacnE6toU2Ix32jb\nOhJSiXYkTAeEXLTx058fJoNJ2DBXXRtiEfwP0DGnCanI1WAyqpdXSumI6kBH\nn28E\r\n=KtHy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJPjZaFbj7Bj9F7TIesr9hU4MkA3F0ovXPfkz8gkLbogIgGM51EU5Hk6Yd0QJpxt74oRcjLLPo+laBnQrnZPnGIxY="}],"size":2485,"noattachment":false,"key":"/hard-rejection/-/hard-rejection-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hard-rejection_2.1.0_1554173126513_0.9019311825096288"},"_hasShrinkwrap":false,"readme":"# hard-rejection [![Build Status](https://travis-ci.org/sindresorhus/hard-rejection.svg?branch=master)](https://travis-ci.org/sindresorhus/hard-rejection)\n\n> Make unhandled promise rejections fail hard right away instead of the default [silent fail](https://gist.github.com/benjamingr/0237932cee84712951a2)\n\nPromises fail silently if you don't attach a `.catch()` handler.\n\nThis module exits the process with an error message right away when an unhandled rejection is encountered.<br>\n**Note: That might not be desirable as unhandled rejections can be [handled at a future point in time](https://nodejs.org/api/process.html#process_event_unhandledrejection), although not common. You've been warned.**\n\nIntended for top-level long-running processes like servers, **but not in reusable modules.**<br>\nFor command-line apps and tests, see [`loud-rejection`](https://github.com/sindresorhus/loud-rejection).\n\n\n## Install\n\n```\n$ npm install hard-rejection\n```\n\n\n## Usage\n\n```js\nconst hardRejection = require('hard-rejection');\nconst promiseFunction = require('some-promise-fn');\n\n// Install the handler\nhardRejection();\n\npromiseFunction();\n```\n\nWithout this module it's more verbose and you might even miss some that will fail silently:\n\n```js\nconst promiseFunction = require('some-promise-fn');\n\nfunction error(error) {\n\tconsole.error(error.stack);\n\tprocess.exit(1);\n}\n\npromiseFunction().catch(error);\n```\n\n### Register script\n\nAlternatively to the above, you may simply require `hard-rejection/register` and the handler will be automagically installed for you.\n\nThis is handy for ES2015 imports:\n\n```js\nimport 'hard-rejection/register';\n```\n\n\n## API\n\n### hardRejection([log])\n\n#### log\n\nType: `Function`<br>\nDefault: `console.error`\n\nCustom logging function to print the rejected promise. Receives the error stack.\n\n\n## Related\n\n- [loud-rejection](https://github.com/sindresorhus/loud-rejection) - Make unhandled promise rejections fail loudly instead of the default silent fail\n- [More…](https://github.com/sindresorhus/promise-fun)\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","publish_time":1554173126609,"_cnpm_publish_time":1554173126609,"dist-tags":{"latest":"2.1.0"}}