cli-alerts-deodat

2.1.2 • Public • Published

cli-alerts

CLI Alerts with customizable design for success, info, warning, error, and custom alerts. Based on Ahmad Awais course.

📟

Install

npm install cli-alerts-deodat

⚙️

Usage

const alert = require('cli-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!

📃

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)


📃

License & Conduct

Package Sidebar

Install

npm i cli-alerts-deodat

Weekly Downloads

0

Version

2.1.2

License

MIT

Unpacked Size

4.74 kB

Total Files

4

Last publish

Collaborators

  • deodat