{"name":"hard-rejection","version":"2.0.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-check"},"keywords":["promise","promises","unhandled","uncaught","rejection","hard","fail","catch","throw","handler","exit","debug","debugging","verbose","immediate","immediately"],"devDependencies":{"ava":"^1.3.1","execa":"^1.0.0","tsd-check":"^0.5.0","xo":"^0.24.0"},"gitHead":"c7ad279b7b0c8264cace7fb487a6f8ef73867d7d","bugs":{"url":"https://github.com/sindresorhus/hard-rejection/issues"},"homepage":"https://github.com/sindresorhus/hard-rejection#readme","_id":"hard-rejection@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-3u5up+jmoSJjmudS3Z3AuqD0pH586torAxsqRFbWT5Zx4fKv3LQj5aWdNJkkSX+VVdSIkf01NJhz+CAF5JtBMw==","shasum":"3831e0e6cd26280b261c0686ca3181af575fca1f","tarball":"http://registry-npm.ywwl.com/hard-rejection/download/hard-rejection-2.0.0.tgz","fileCount":6,"unpackedSize":4860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjkNfCRA9TVsSAnZWagAAPBYP/2rMMwidlhDzPUO0X1S3\nMSsNUJwglz8g3VcKF8JGXv7f7ei4bJUYw6YNrVQCqF7TMsWpIvPIoMyTf8NJ\n8wVC2uGMkwn+Tz8Dyjzge/cdjRcneEkt8HszuyjKxN3AFpwG59L7owrnkYmd\nKCVuUKcdE7SZJLXqtZ49QNACfbmJNIERxOIEqwIiIt1JLtZ/HnonEXx/+R4o\nds5gOmSLS+KenFjZ17klduv9XJpRwvloxs8MnnbnMm9dhUJFZ2hRdo0RlD80\nqHt042DrP46dzLyrWuUIBTlwAxnUwFc/Z6JglejiSSexvWzvGDWwU9XK2FTP\nCJdi+nUbN/4otDy4FXMM8/j4M+77cgt0lNYZbRbNroXwnbCooj4HbTX4taPt\nsguhIeeReHrD/tZJUY32ngOtxfUB09RUvL8KsSnr4eHKVwbQ2bl5yy4UaMpY\niYA92Y4YXaz1n9iZ57Nh/BuzHGJ0xKin6sDA8GNv5XDT0jg7KrUM9CS25fWt\nR2yyrF/OZNj3dc5GGAjw9tzq9G1xkwTjcZxbH7dRZQxHYw0LHAiKpDt/FpWx\nCi+vbPlDbxl5Rin+jZcUS89TZ6khvf9vuCd/85CUOPT2dhihe01jZSl6tvwo\nyvkxWiy2/5AVMrgc9qwJcWiUjDlkqCi1uxv8G9sl6nEn58VI1Q5WByolnDUa\nI+Cp\r\n=NC4l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5BfOL+QHm5s/oPpGGjjluLtBcvYXPRv0CUThFjLch9AiEA5zCcFj7s/6aGSAm07FwcKYn3zjOZaCbHHGdI+EwY08Y="}],"size":2400,"noattachment":false,"key":"/hard-rejection/-/hard-rejection-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hard-rejection_2.0.0_1552827230430_0.6926210459554436"},"_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":1552827230619,"_cnpm_publish_time":1552827230619,"dist-tags":{"latest":"2.1.0"}}