0.2.0 • Published 1 year ago

color-loggers v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

color loggers

Print to console with colors.

Install

yarn add color-loggers

Use

import { Blue, Green, Red } from 'color-loggers';

const info = new Blue();
const success = new Green();
const error = new Red();

info.log('This is an information.');
success.log('Congratulations!');
error.log('Something is wrong!');

Sample output

npm.io

Change the prefix

const info = new Blue('👉');
const success = new Green('🎉');
const error = new Red('⛔️');

info.log('This is an information.');
success.log('Congratulations!');
error.log('Something is wrong!');

npm.io

Dynamic prefix

const info = new Blue(() => `[${new Date()}]:`);
info.log('This is an information.');

Output:

 [Thu Mar 02 2023 11:37:55 GMT-0800 (Pacific Standard Time)]: This is an information.
0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago