Gem 一覧へ戻る
ahmadawais/cli-handle-error(新しいタブで開きます)
主要言語: JavaScript
Custom error handler for Node.js CLIs.
- star 数
- 12
- watcher 数
- 1
- fork 数
- 3
- issue 数
- 0
- 最終更新
- 2026/05/15
主要言語: JavaScript
Custom error handler for Node.js CLIs.
Custom error handler for Node CLIs
npm install node-cli-handle-error
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);
Type: string
Heading of the error message.
Type: error/object
Type: boolean
Default: true (optional)
Display the error message or not.
Type: boolean
Default: true (optional)
Exit the CLI on error or not?
KEY: 📦 NEW, 👌 IMPROVE, 🐛 FIX, 📖 DOC, 🚀 RELEASE, and ✅ TEST
I use Emoji-log, you should try it and simplify your git commits.