Skip to content

Commit d4add03

Browse files
authored
refactor: use nanocolors instead of chalk (#56)
1 parent 4159c65 commit d4add03

File tree

3 files changed

+8047
-5
lines changed

3 files changed

+8047
-5
lines changed

lib/log.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const { Console } = require('console');
4-
const chalk = require('chalk');
4+
const nanocolors = require('nanocolors');
55

66
const TRACE = 10;
77
const DEBUG = 20;
@@ -55,14 +55,14 @@ class Logger {
5555
const str = new Date().toISOString().substring(11, 23) + ' ';
5656

5757
if (level === TRACE || level >= WARN) {
58-
process.stderr.write(chalk[LEVEL_COLORS[DEBUG]](str));
58+
process.stderr.write(nanocolors[LEVEL_COLORS[DEBUG]](str));
5959
} else {
60-
process.stdout.write(chalk[LEVEL_COLORS[DEBUG]](str));
60+
process.stdout.write(nanocolors[LEVEL_COLORS[DEBUG]](str));
6161
}
6262
}
6363

6464
if (level >= this.level) {
65-
const str = chalk[LEVEL_COLORS[level]](LEVEL_NAMES[level]) + ' ';
65+
const str = nanocolors[LEVEL_COLORS[level]](LEVEL_NAMES[level]) + ' ';
6666
if (level === TRACE || level >= WARN) {
6767
process.stderr.write(str);
6868
} else {

0 commit comments

Comments
 (0)