@luca.bottoni/easy-console-log

1.0.2 • Public • Published

easy-console-log

easy and basic console log for node applications. This package use chalk.js in background.

Installation

npm i `@luca.bottoni/easy-console-log`

How to use

you can use any single command or require one object.

const { Log,Debug,Err,Warn,Info,Success,Dir} = require('@luca.bottoni/easy-console-log');

Debug('this is a Debug');
Err('this is a Err',false);
Info('this is a Info');
Log('this is a Log');
Success('this is a Success');
Warn('this is a Warn');
Dir(["data1", "data2"]);
console.custom('CUSTOM MSG', 'this is a custom');

full example

Custom Messages

any message have a label plus messages (same if use console.log separate from comma).

Log('this is a Log','Log 2','Log 3');

if you want use a label custom, you can use console.custom, and pass in the fist parameter the colored label

console.custom('CUSTOM MSG', 'this is a custom');
console.custom('CUSTOM MSG', 'this is a custom');
console.custom('CUSTOM MSG', 'this is a custom');

custom message

Block code

the Easy Messages "Success and Info" for default use the second parameter in default to false, but the "Err" use for default the blocke parameters to true

Log('Log 1','Log 2','Log 3'); //this is printed
Err('this is a block error message');
Log('Log 4','Log 5','Log 6');//this is not printed

blocked message

Log('Log 1','Log 2','Log 3'); //this is printed
Err('this is a block error message',false);
Log('Log 4','Log 5','Log 6');//this is printed

error not blocked

Readme

Keywords

Package Sidebar

Install

npm i @luca.bottoni/easy-console-log

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

3.21 kB

Total Files

2

Last publish

Collaborators

  • luca.bottoni