4.4.0 โ€ข Published 4 years ago

cli-handle-error v4.4.0

Weekly downloads
959
License
MIT
Repository
github
Last release
4 years ago

node-cli-handle-error

DOWNLOADS Learn VSCode Follow @MrAhmadAwais on Twitter

Custom error handler for Node CLIs

๐Ÿ“Ÿ

Install

npm install node-cli-handle-error

โš™๏ธ

Usage

const handleError = require('cli-handle-error');

// Let's say we get an error message from a custom command.
const [err, res] = await somePromise();

// Use the function. It will print the error and exit if there is an error.
handleError(`Failed while building on step #1`, err);

๐Ÿ“ƒ

API

handleError(heading, err, displayError?, exit?)

โฏ heading

Type: string

Heading of the error message.

โฏ err

Type: error/object

โฏ displayError

Type: boolean Default: true (optional)

Display the error message or not.

โฏ exit

Type: boolean Default: true (optional)

Exit the CLI on error or not?

๐Ÿ“

Changelog

โฏ Read the changelog here โ†’

KEY: ๐Ÿ“ฆ NEW, ๐Ÿ‘Œ IMPROVE, ๐Ÿ› FIX, ๐Ÿ“– DOC, ๐Ÿš€ RELEASE, and โœ… TEST

I use Emoji-log, you should try it and simplify your git commits.

๐Ÿ“ƒ

License & Conduct

๐Ÿ™Œ

Connect

๐Ÿ‘Œ

Sponsor

Me (Ahmad Awais) and my incredible wife (Maedah Batool) are two engineers who fell in love with open source and then with each other. You can read more about me here. If you or your company use any of my projects or like what Iโ€™m doing then consider backing me. I'm in this for the long run. An open-source developer advocate.

Or you can back me by checking out my super fun video course. As developers, we spend over 200 Hrs/month with our code editors โ€” it's only fair to learn your next editor deeply. This course will save you 15-20 hours every month. Become a VSCode Power User โ†’

VSCODE

VSCode Ahmad on Twitter

aui-generatorcreate-gattodotbackuptesting-covid-19-cli-khabubucorona-indiacovin-cli-indiadeferred-maintenancepandemic-covid19-tracker@ifqthenp/create-node-cliiamrokt@iamrokt/todo-cliduration-cliantonioqfel@joeycrowle/regex-gengsambou@nur.js/nurjs@node-update-release/nurjs@rameardo/cfw-clidhruvil-clicreate-file-cli-testget-wifi-pwdnac-climilind@everything-registry/sub-chunk-1335create-vite-react-eslintyala-component-cliwealwappalyzer-multiplewappalyzer-multiple-2wc23-cliwampark-devkitwhoamiguillermoweb3libwirvsvirus-topics-cliwooffwordlesswordle-solved-cliwp-tested-up-to-cliwp-release-itwpp-spamtools-clickwithclarkthindtest-cli-dontest-cli-donbasilpetertsf-clitweespacestwopine-fundament-cli@ezeamin/pre-build@freshworks/crayons-icon@gbrachetta/repocreatevalidate-rss-sitemapvhosurvcreatevercel-no-commentsuni-xz-cli@fork-hu/clisupreme-bot-by-pkt0ddutabz-clisvgxrsystemviewt3ktbanystekstgjennomgang@infinitebrahmanuniverse/nolb-cli-h@guineatech/224tech@guillermobrachetta/cli-todo@guillermobrachetta/nclires-imgremove-console-statementsseritysaildsajadscratch-sr-cliscarfitrows-to-arrayrpn-calc-clirpg-worldmap-clisharifsheet-pagessite-inspectsitemaps-comparesmart-makersmartmakesp-server-creatorsteam-otp-clistart-new-projectstyksstacker-plugin-clistart-right-clisub-adjustersteven-tripari@maxklammer/move-component@maxklammer/new-blog@maxklammer/new-component@maxklammer/surface-random-notion-note@jupiterone/deferred-maintenance@idigitworx/covid19-cli@micromerger/dependency-doctor@muriukivincent/create-ts-app
4.4.0

4 years ago

4.3.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

2.2.1

4 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago