error-handle-cli
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

/error-handle-cli/

    Package Sidebar

    Install

    npm i error-handle-cli

    Weekly Downloads

    3

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    4.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • csalam07