Skip to content

gsambou/log-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published