1.0.1 • Published 3 years ago

ke-cli-alerts v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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)