@datdp88/nodejs-datdp-pretty-console-log
v0.0.3
Published
Pretty console log for nodeJS
Readme
Pretty console log for nodejs
Add filename, line number to console log
How to use?
require to first line in main file JS
require('@datdp88/nodejs-datdp-pretty-console-log')
Example
log
arr = [1, 2, 3, 4, 5, "dat", 6, 7, 8, `quynh`]
obj = {
dat: {
name: "Tiến Đạt",
add: "Vietnam",
year: 1988,
},
quynh: {
name: "Văn Quỳnh",
add: "Vietnam",
year: 1995,
}
}
console.log(`one`);
console.log(`one`, 2);
console.log(`one`, 2, `3`);
console.log(arr);
console.log(`This is array:`, arr);
console.log(obj);
console.log(`This is object:`, obj);
info - debug - warn - error
console.info(`Info`);
console.debug(`Debug`);
console.warn(`Warning`);
console.error(`Error`);
obj
console.obj(arr);
console.obj(`This is array`, arr);
console.obj(obj);
console.obj(`This is object`, obj);
String color
console.log(`_bg_yellow =============_bg_red START APP _bg_yellow =============`);

| string | note | code | example |
| -------------- | ------------------------------------------ | ------------------------------------------------ | ------------------------------------- |
| _clr | Clear all | | |
| _bright | bright light text | console.log(_bright _red Bright); |
|
| _underscore | Underscore text | console.log(_underscore Underscore); |
|
| _blink | | | |
| ------------ | ------------ | ------------ | ------------ |
| _bg_black | Background color black | | |
| _bg_red | Background color red + text color white | | |
| _bg_green | Background color green | console.log(_bg_green Background color green); | |
| _bg_yellow | Background color yellow + text color black | | |
| _bg_blue | Background color blue | | |
| _bg_pink | Background color pink | | |
| _bg_lightblue | Background color lightblue | | |
| _bg_white | Background color white + text color black | | |
| ------------ | ------------ | ------------ | ------------ |
| _black | Text color black | | |
| _red | Text color red | console.log(_red Text color red); | |
| _green | Text color green | | |
| _yellow | Text color yellow | | |
| _blue | Text color blue | | |
| _pink | Text color pink | | |
| _lightblue | Text color lightblue | | |
| _white | Text color white | | |
