This custom logger includes moment & chalk. \nwhich will give you a timestamp as well as different color options when logging!
Install moment :
npm install -g moment
Install chalk version 4.1.2:
npm install -g [email protected]
At the top of your file:
const log = require(filpath/to/logger.js)
Below will be examples on different types of colors:
log(x, 'error') -> Red
log(x, 'success') -> Green
log(x, 'info') -> Blue
log(x, 'yellow') -> Yellow
log(x, 'lightpurple') -> Light Purple
log(x, 'lightgray') -> Light Gray
log(x, 'debug') -> Purple
log(x, 'reset') -> Clear