alert-log

1.0.5 • Public • Published

Capture d’écran 2022-11-14 à 09 03 23


CLI Alerts with colors & colored symbols for success, info, warning, error.


alert-log

image


Install

npm install alert-log

image


Usage

import alert from 'alert-log';

OR

const alert = require('alert-log');
// Provide the type, msg and name options

alert({ type: `success`, msg: `All done!` });
// Prints: ✔   SUCCESS   All done!

alert(`success`, `All done!`);
// Prints: ✔   SUCCESS   All done!

alert({ type: `warning`, msg: `You didn't add something` });
// Prints:  ⚠   WARNING   You didn't add something

alert(`warning`, `You didn't add something`);
// Prints:  ⚠   WARNING   You didn't add something

alert({ type: `info`, msg: `Awesome cli app` });
// Prints:  ℹ   INFO   Awesome cli app
alert(`info`, `Awesome cli app`);
// Prints:  ℹ   INFO   Awesome cli app

alert({ type: `error`, msg: `Something went wrong` });
// Prints: ⨯   ERROR   Something went wrong
alert(`error`, `Something went wrong`);
// Prints: ⨯   ERROR   Something went wrong

image

API


alert(options)

❯ options

Type: object
Default: {}

You can specify the options below.

❯ type

Type: string
Default: error

❯ msg

Type: string
Default: You provided an invalid type

❯ name

Type: string
Default: You provided an invalid type


alert(type, msg, name);

You can specify the options below.

❯ type

Type: string
Default: error

❯ msg

Type: string
Default: You provided an invalid type

❯ name

Type: string
Default: error


image

License & Conduct


image

Connect

Twitter @gsdotdev  follow me for more Open-Source Projects

Package Sidebar

Install

npm i alert-log

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

6.1 kB

Total Files

4

Last publish

Collaborators

  • gsambou