1.0.2 • Published 2 years ago

error-handle-cli v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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