error-handle-cli
v1.0.2
Published
Let you customize error handle for Node CLI
Downloads
7
Maintainers
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
- MIT © cslam07