cli-msg ·
Colored CLI messages for better log messages
Install
yarn add cli-msg
npm install cli-msg --save
Naming conventions used
Badge
- Badge text refers to the text with primary color applied to the background.
Message
- Message text refers to the colored text with the transparent background.
Usage
Message type usage
const success = ; // only 1 argument;
// 2 or more arguments// 1st argument is shown in badge text and remaining args shown as one message;
// Specific message styles// b - badge style type// Only badge style text, no message textsuccess;
// m - message style type// Only message style text, no badge text// All arguments are joined together for the messagesuccess;
// wb - with default badge - Eg. info will have 'INFO' as the badge text// message with badge text 'SUCCESS'success;
Same applies to success, warn, log, error, info message types.
indent
This function is used to position the cursor according to your choice using
- nl - newline (/n)
- tab - tab (/t)
- space - space (' ')
The inner functions are cascaded.
Sample usage
const indent = ; warn;indent // New Line // Tab Space ; // Spaceerror;
License
MIT