From f60c26e5411b9280769eaf52a1bcc90f8adbb2a9 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 5 Nov 2018 16:32:08 +0700 Subject: [PATCH] Switch from `loud-rejection` to `hard-rejection` The difference is that now it will crash the process right away on unhandled promises instead of waiting until the process exits. Fixes #93 --- index.js | 4 ++-- package.json | 2 +- readme.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 24dbb46..7dd86ab 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ const decamelizeKeys = require('decamelize-keys'); const trimNewlines = require('trim-newlines'); const redent = require('redent'); const readPkgUp = require('read-pkg-up'); -const loudRejection = require('loud-rejection'); +const hardRejection = require('hard-rejection'); const normalizePackageData = require('normalize-package-data'); // Prevent caching of this module so module.parent is always accurate @@ -15,7 +15,7 @@ delete require.cache[__filename]; const parentDir = path.dirname(module.parent.filename); module.exports = (helpMessage, options) => { - loudRejection(); + hardRejection(); if (typeof helpMessage === 'object' && !Array.isArray(helpMessage)) { options = helpMessage; diff --git a/package.json b/package.json index b217426..f84a2cf 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "dependencies": { "camelcase-keys": "^4.0.0", "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", + "hard-rejection": "^1.0.0", "minimist-options": "^3.0.1", "normalize-package-data": "^2.3.4", "read-pkg-up": "^3.0.0", diff --git a/readme.md b/readme.md index 9261f1e..78e6f31 100644 --- a/readme.md +++ b/readme.md @@ -12,7 +12,7 @@ - Negates flags when using the `--no-` prefix - Outputs version when `--version` - Outputs description and supplied help text when `--help` -- Makes unhandled rejected promises [fail loudly](https://github.com/sindresorhus/loud-rejection) instead of the default silent fail +- Makes unhandled rejected promises [fail hard](https://github.com/sindresorhus/hard-rejection) instead of the default silent fail - Sets the process title to the binary name defined in package.json @@ -237,7 +237,7 @@ const cli = meow(` ## Promises -Meow will make unhandled rejected promises [fail loudly](https://github.com/sindresorhus/loud-rejection) instead of the default silent fail. Meaning you don't have to manually `.catch()` promises used in your CLI. +Meow will make unhandled rejected promises [fail hard](https://github.com/sindresorhus/hard-rejection) instead of the default silent fail. Meaning you don't have to manually `.catch()` promises used in your CLI. ## Tips