Skip to content

Commit b35a04f

Browse files
authored
Merge pull request #812 from jorgebucaran/master
refactor: replace colors with colorette
2 parents c7ee4aa + 2b92b42 commit b35a04f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

bin/lib/start.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const options = require('./options')
44
const fs = require('fs')
55
const extend = require('extend')
6-
const colors = require('colors/safe')
6+
const { cyan, red, bold } = require('colorette')
77

88
module.exports = function (program, server) {
99
const start = program
@@ -29,7 +29,7 @@ module.exports = function (program, server) {
2929
fs.readFile(configFile, (err, file) => {
3030
// No file exists, not a problem
3131
if (err) {
32-
console.log(colors.cyan.bold('TIP'), 'create a config.json: `$ solid init`')
32+
console.log(cyan(bold('TIP')), 'create a config.json: `$ solid init`')
3333
} else {
3434
// Use flags with priority over config file
3535
const config = JSON.parse(file)
@@ -123,17 +123,17 @@ function bin (argv, server) {
123123
} catch (e) {
124124
if (e.code === 'EACCES') {
125125
if (e.syscall === 'mkdir') {
126-
console.log(colors.red.bold('ERROR'), `You need permissions to create '${e.path}' folder`)
126+
console.log(red(bold('ERROR')), `You need permissions to create '${e.path}' folder`)
127127
} else {
128-
console.log(colors.red.bold('ERROR'), 'You need root privileges to start on this port')
128+
console.log(red(bold('ERROR')), 'You need root privileges to start on this port')
129129
}
130130
return 1
131131
}
132132
if (e.code === 'EADDRINUSE') {
133-
console.log(colors.red.bold('ERROR'), 'The port ' + argv.port + ' is already in use')
133+
console.log(red(bold('ERROR')), 'The port ' + argv.port + ' is already in use')
134134
return 1
135135
}
136-
console.log(colors.red.bold('ERROR'), e.message)
136+
console.log(red(bold('ERROR')), e.message)
137137
return 1
138138
}
139139
app.listen(argv.port, function () {

package-lock.json

Lines changed: 4 additions & 4 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"body-parser": "^1.18.3",
3838
"busboy": "^0.2.12",
3939
"camelize": "^1.0.0",
40-
"colors": "^1.1.2",
40+
"colorette": "^1.0.5",
4141
"commander": "^2.9.0",
4242
"cors": "^2.7.1",
4343
"debug": "^2.6.9",

0 commit comments

Comments
 (0)