Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Promises
  3. loud-rejection

loud-rejection

MITJavaScriptv2.2.0

Make unhandled promise rejections fail loudly and exit with code 1 instead of silently failing.

GitHubGitHub
282 stars16 forks0 contributors

What is loud-rejection?

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.

Target Audience

Node.js developers building CLI tools, tests, or applications who need to guarantee that unhandled promise rejections are visible and cause process failure.

Value Proposition

It provides a simple, zero-configuration way to enforce loud failures for unhandled rejections, reducing debugging time and preventing hidden errors in production environments.

Overview

Make unhandled promise rejections fail loudly instead of the default silent fail

Use Cases

Best For

  • Ensuring CLI tools exit with code 1 on unhandled promise rejections
  • Making test suites fail loudly when promises reject unexpectedly
  • Debugging applications with silent promise failures
  • Enforcing error visibility in Node.js apps before version 15
  • Adding global unhandled rejection handlers without boilerplate
  • Customizing how unhandled rejections are logged before exit

Not Ideal For

  • Projects using Node.js version 15 or higher, where default behavior already handles unhandled rejections
  • Reusable Node.js modules, as the README explicitly advises against it for library code
  • Browser-based applications, since it's designed only for Node.js environments
  • Applications requiring graceful error recovery without process termination, due to its forced exit on unhandled rejections

Pros & Cons

Pros

Simple Integration

Offers easy setup via require() or import, with automatic registration using 'loud-rejection/register', reducing boilerplate code for global error handling.

Ensures Error Visibility

Logs unhandled promise rejections to STDERR and exits with code 1, preventing silent failures that could hide critical bugs in production.

Custom Logging Support

Allows passing an optional logging function to control error output, providing flexibility for formatting or redirecting error messages.

Global Rejection Tracking

Monitors all promises globally, ensuring no unhandled rejection goes unnoticed, which is essential for debugging CLI tools and tests.

Cons

Obsolete in Modern Node.js

With Node.js 15 and above, the default behavior throws on unhandled rejections, making this package unnecessary and limiting its relevance for newer projects.

Forced Process Exit

Always terminates the process on unhandled rejections, which can be too aggressive for applications needing graceful shutdowns or error recovery mechanisms.

Limited Application Scope

Not recommended for reusable modules, restricting use to top-level applications like CLI tools and tests, as per the README's guidance.

Frequently Asked Questions

Quick Stats

Stars282
Forks16
Contributors0
Open Issues0
Last commit5 years ago
CreatedSince 2015

Tags

#promises#nodejs#testing#error-handling#debugging#cli-tools#process-management

Built With

N
Node.js

Included in

Promises1.7k
Auto-fetched 18 hours ago

Related Projects

p-queuep-queue

Promise queue with concurrency control

Stars4,244
Forks213
Last commit2 days ago
p-limitp-limit

Run multiple promise-returning & async functions with limited concurrency

Stars2,906
Forks137
Last commit4 days ago
pifypify

Promisify a callback-style function

Stars1,505
Forks73
Last commit1 day ago
p-mapp-map

Map over promises concurrently

Stars1,504
Forks74
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub