Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

error-handle-cli

csalam079MIT1.0.2TypeScript support: included

Let you customize error handle for Node CLI

cli, console, error, handle, error-handle, cli-error-handle, cli-error-msg, cli-error, cli-error-console, cli-my-console, cli-your-console, cli-all-console, cli error windows, cli error macos, cli error linux, cli error windows mac linux, csalam, csalam07

readme

error-handle-cli

Let you customize error handle for Node CLI


Installation

npm

npm install erro-handle-cli

Yarn

yarn add error-handle-cli

Usage

import handleError = from 'error-handle-cli';

const [err, res] = await somePromise();

handleError(`Failed to build resources`, 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?


License