js-cli-alerts

1.0.0 • Public • Published

Cross platform CLI Alerts with colors & colored symbols for success, info, warning, error.
Work on macOS, Linux, and Windows.

Follow @jayontasarkar on Twitter


cli-alerts

Install

npm install js-cli-alerts

Usage

const alert = require('js-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)

Changelog

❯ Read the changelog here →


KEY: 📦 NEW, 👌 IMPROVE, 🐛 FIX, 📖 DOC, 🚀 RELEASE, and 🤖 TEST

I use Emoji-log, you should try it and simplify your git commits.

License & Conduct

Connect

GitHub @jayontasarkar (follow) To stay up to date on free & open-source software

Twitter @jayontasarkar (follow) To get #OneDevMinute daily hot tips & trolls

LinkedIn @jayontasarkar (connect) On the LinkedIn profile y'all

Sponsor

Me (Jayonta Sarkar) who fell in love with open source. If you or your company use any of my projects or like what I’m doing then consider backing me. I'm in this for the long run. An open-source developer advocate.

Me on Twitter

Package Sidebar

Install

npm i js-cli-alerts

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.71 kB

Total Files

5

Last publish

Collaborators

  • jayontasarkar