Skip to content

Commit fe8dda7

Browse files
authored
chore: migrate to colorette (#3557)
1 parent 61e8a10 commit fe8dda7

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/Server.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,8 @@ class Server {
12151215
}
12161216

12171217
logStatus() {
1218+
const colorette = require("colorette");
1219+
12181220
const getColorsOption = (configArray) => {
12191221
const statsOption = this.getStatsOption(configArray);
12201222

@@ -1227,20 +1229,17 @@ class Server {
12271229
return colorsEnabled;
12281230
};
12291231

1230-
// TODO change it on https://www.npmjs.com/package/colorette
12311232
const colors = {
12321233
info(useColor, msg) {
12331234
if (useColor) {
1234-
// Make text blue and bold, so it *pops*
1235-
return `\u001b[1m\u001b[34m${msg}\u001b[39m\u001b[22m`;
1235+
return colorette.cyan(msg);
12361236
}
12371237

12381238
return msg;
12391239
},
12401240
error(useColor, msg) {
12411241
if (useColor) {
1242-
// Make text red and bold, so it *pops*
1243-
return `\u001b[1m\u001b[31m${msg}\u001b[39m\u001b[22m`;
1242+
return colorette.red(msg);
12441243
}
12451244

12461245
return msg;

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"ansi-html": "^0.0.7",
3535
"bonjour": "^3.5.0",
3636
"chokidar": "^3.5.1",
37+
"colorette": "^1.2.2",
3738
"compression": "^1.7.4",
3839
"connect-history-api-fallback": "^1.6.0",
3940
"del": "^6.0.0",

0 commit comments

Comments
 (0)