node-alerts
v2.0.2
Published
Cross platform CLI alerts with colors. Works on macOS, Linux, and Windows. Alerts: success, error, warning, info, question, and log.
Downloads
3
Readme
node-alerts
Install
npm install node-alerts
Usage
const alert = require('node-alerts');
// Provide the type, msg, and name options.
alert({type: `success`, msg: `Everything finished!`});
// Prints: ✔ SUCCESS Everything finished!
alert({type: `success`, msg: `Everything finished!`, name: `DONE`});
// Prints: ✔ DONE Everything finished!
alert({type: `warning`, msg: `You didn't add something!`});
// Prints: ⚠ WARNING You didn't add something!
alert({type: `info`, msg: `Awais is awesome!`});
// Prints: ℹ INFO Awais is awesome!
alert({type: `error`, msg: `Something went wrong!`});
// Prints: ✖ ERROR Something went wrong!
alert({type: `question`, msg: `Are you sure?`});
// Prints: ? QUESTION Are you sure?
alert({type: `log`, msg: `10:03 - Server is up and running!`});
// Prints: ⚙️ LOG 10:03 - Server is up and running!
API
alert(options)
❯ options
Type: object
Default: {}
You can specify the options below.
❯ type
Type: string
Default: error
❯ msg
Type: string
Default: You forgot to define all options.
(Error message)
❯ name
Type: string
Default: ''
(Empty string)