alert-log
v1.0.5
Published
CLI Alerts with colors & colored symbols for success, info, warning, error
Downloads
16
Maintainers
Readme
alert-log
Install
npm install alert-log
Usage
import alert from 'alert-log';
OR
const alert = require('alert-log');
// Provide the type, msg and name options
alert({ type: `success`, msg: `All done!` });
// Prints: ✔ SUCCESS All done!
alert(`success`, `All done!`);
// Prints: ✔ SUCCESS All done!
alert({ type: `warning`, msg: `You didn't add something` });
// Prints: ⚠ WARNING You didn't add something
alert(`warning`, `You didn't add something`);
// Prints: ⚠ WARNING You didn't add something
alert({ type: `info`, msg: `Awesome cli app` });
// Prints: ℹ INFO Awesome cli app
alert(`info`, `Awesome cli app`);
// Prints: ℹ INFO Awesome cli app
alert({ type: `error`, msg: `Something went wrong` });
// Prints: ⨯ ERROR Something went wrong
alert(`error`, `Something went wrong`);
// Prints: ⨯ ERROR Something went wrong
API
alert(options)
❯ options
Type: object
Default: {}
You can specify the options below.
❯ type
Type: string
Default: error
❯ msg
Type: string
Default: You provided an invalid type
❯ name
Type: string
Default: You provided an invalid type
alert(type, msg, name);
You can specify the options below.
❯ type
Type: string
Default: error
❯ msg
Type: string
Default: You provided an invalid type
❯ name
Type: string
Default: error
License & Conduct
- MIT © gsambou
- Code of Conduct