loud-rejection alternatives and similar modules
Based on the "Command Line Utilities" category.
Alternatively, view loud-rejection alternatives based on common mentions on social networks and blogs.
-
nvm
Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions -
Inquirer.js
A collection of common interactive command line user interfaces. -
KeyboardJS
A JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts. -
omelette
Omelette is a simple, template based autocompletion tool for Node and Deno projects with super easy API. (For Bash, Zsh and Fish) -
log-update
Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc. -
configstore
Easily load and persist config without having to think about where and how -
insight
Node.js module to help you understand how your tool is being used by anonymously reporting usage metrics to Google Analytics -
Javascript library for 2d geometry
Javascript library for 2d geometry -
string-width
Get the visual width of a string - the number of columns required to display it -
columnify
Create text-based columns suitable for console output. Supports cell wrapping. -
multispinner
Multiple, simultaneous, individually controllable spinners for concurrent tasks in Node.js CLI programs -
sudo-block
Block users from running your app with root permissions -
googleauth
Create and load persistent Google authentication tokens for command-line apps -
licenseye
Node.js CLI tool to visualize an aggregate list of your dependencies' licenses -
cli-columns
Columnated lists for the CLI. Unicode and ANSI safe. -
cron-to-quartz
Node.js library to convert unix or linux CRON syntax to Quartz Scheduler
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of loud-rejection or a related project?
README
loud-rejection
Make unhandled promise rejections fail loudly instead of the default silent fail
By default, promises fail silently if you don't attach a .catch()
handler to them.
This tool keeps track of unhandled rejections globally. If any remain unhandled at the end of your process, it logs them to STDERR and exits with code 1.
Use this in top-level things like tests, CLI tools, apps, etc, but not in reusable modules. Not needed in the browser as unhandled rejections are shown in the console.
With Node.js 15, this package is moot as the default behavior then is to throw on unhandled rejections.
Install
$ npm install loud-rejection
Usage
const loudRejection = require('loud-rejection');
const promiseFunction = require('promise-fn');
// Install the `unhandledRejection` listeners
loudRejection();
promiseFunction();
Without this module it's more verbose and you might even miss some that will fail silently:
const promiseFunction = require('promise-fn');
function error(error) {
console.error(error.stack);
process.exit(1);
}
promiseFunction().catch(error);
Register script
Alternatively to the above, you may simply require loud-rejection/register
and the unhandledRejection listener will be automagically installed for you.
This is handy for ES2015 imports:
import 'loud-rejection/register';
API
loudRejection([log])
log
Type: Function
Default: console.error
Custom logging function to print the rejected promise. Receives the error stack.
Related
- hard-rejection - Make unhandled promise rejections fail hard right away instead of the default silent fail
- Moreβ¦
Get professional support for this package with a Tidelift subscription Tidelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, and licensing for their dependencies.