Make unhandled promise rejections fail loudly and exit with code 1 instead of silently failing.
loud-rejection is a Node.js library that makes unhandled promise rejections fail loudly by logging them and exiting the process. It solves the problem of silent failures in applications where promises might reject without proper error handling, ensuring developers don't miss critical bugs.
Node.js developers building CLI tools, tests, or applications who need to guarantee that unhandled promise rejections are visible and cause process failure.
It provides a simple, zero-configuration way to enforce loud failures for unhandled rejections, reducing debugging time and preventing hidden errors in production environments.
Make unhandled promise rejections fail loudly instead of the default silent fail
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers easy setup via require() or import, with automatic registration using 'loud-rejection/register', reducing boilerplate code for global error handling.
Logs unhandled promise rejections to STDERR and exits with code 1, preventing silent failures that could hide critical bugs in production.
Allows passing an optional logging function to control error output, providing flexibility for formatting or redirecting error messages.
Monitors all promises globally, ensuring no unhandled rejection goes unnoticed, which is essential for debugging CLI tools and tests.
With Node.js 15 and above, the default behavior throws on unhandled rejections, making this package unnecessary and limiting its relevance for newer projects.
Always terminates the process on unhandled rejections, which can be too aggressive for applications needing graceful shutdowns or error recovery mechanisms.
Not recommended for reusable modules, restricting use to top-level applications like CLI tools and tests, as per the README's guidance.