CLI Alerts with colors & colored symbols for success, info, warning, error
npm install alert-log!Capture d’écran 2022-11-14 à 09 03 23
``sh`
npm install alert-log
js
import alert from 'alert-log';
`
OR
`js
const alert = require('alert-log');
``js// 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 somethingalert(
warning, You didn't add something);
// Prints: ⚠ WARNING You didn't add somethingalert({ type:
info, msg: Awesome cli app });
// Prints: ℹ INFO Awesome cli app
alert(info, Awesome cli app);
// Prints: ℹ INFO Awesome cli appalert({ type:
error, msg: Something went wrong });
// Prints: ⨯ ERROR Something went wrong
alert(error, Something went wrong);
// Prints: ⨯ ERROR Something went wrong
`API
`js
alert(options)
`
#### ❯ optionsType:
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
`js
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`- MIT © gsambou
- Code of Conduct