0.0.3 • Published 3 years ago

@datdp88/nodejs-datdp-pretty-console-log v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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')

npm.io

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);

npm.io

info - debug - warn - error

console.info(`Info`);
console.debug(`Debug`);
console.warn(`Warning`);
console.error(`Error`);

npm.io

obj

console.obj(arr);
console.obj(`This is array`, arr);

npm.io

console.obj(obj);
console.obj(`This is object`, obj);

npm.io

String color

console.log(`_bg_yellow =============_bg_red START APP _bg_yellow =============`);

npm.io

npm.io

stringnotecodeexample
_clrClear all
_brightbright light textconsole.log(_bright _red Bright);npm.io
_underscoreUnderscore textconsole.log(_underscore Underscore);npm.io
_blink
------------------------------------------------
_bg_blackBackground color black
_bg_redBackground color red + text color white
_bg_greenBackground color greenconsole.log(_bg_green Background color green);
_bg_yellowBackground color yellow + text color black
_bg_blueBackground color blue
_bg_pinkBackground color pink
_bg_lightblueBackground color lightblue
_bg_whiteBackground color white + text color black
------------------------------------------------
_blackText color black
_redText color redconsole.log(_red Text color red);
_greenText color green
_yellowText color yellow
_blueText color blue
_pinkText color pink
_lightblueText color lightblue
_whiteText color white