ke-cli-alerts

1.0.1 • Public • Published

Cross platform CLI Alerts with colours and colored symbols for success, info, warning and error. It works on Mac OS, GNU/Linux and Windows.


ke-cli-alerts

Install

npm install ke-cli-alerts

Usage

const alert = require('ke-cli-alerts');
 
// Provide the type, msg, options.
alert({type: 'success', msg: 'All done!'});
// Prints: ✔ SUCCESS All done!

alert({type: 'info', msg: 'There is an update available'});
// Prints: ℹ INFO There is an update available

alert({type: 'warning', msg: `You didn't add something!`});
// Prints: ⚠ WARNING You didn't add something!
 
alert({type: 'error', msg: 'Something went wrong!'});
// Prints: ✖ ERROR Something went wrong!

You can also pass the name if you want to change the label name:

alert({type: 'success', msg: 'Everything finished!', name: 'DONE'});
// Prints: ✔ DONE Everything finished!

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)

Package Sidebar

Install

npm i ke-cli-alerts

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

4.71 kB

Total Files

4

Last publish

Collaborators

  • k3rnel_err0r