cli-error-handler
Error handler for nodeJs.
![📟](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/install.png)
Install
npm install cli-error-handler
![⚙️](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/usage.png)
Usage
const handleError = require('cli-error-handler');
const [err, res] = await somePromise();
handleError(`Failed while building on step #1`, err);
![📃](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/options.png)
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?
Connect
(follow) To stay up to date on free & open-source software
(follow) To get tech updates/small>
(connect) On the LinkedIn profile y'all