Skip to content

Commit 1ebd0e1

Browse files
committed
upgrade: swap chalk→turbocolor
1 parent 0f6a4bc commit 1ebd0e1

File tree

5 files changed

+53
-278
lines changed

5 files changed

+53
-278
lines changed

lib/helpers/error-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Dependencies
55
*/
6-
const chalk = require('chalk');
6+
const tc = require('turbocolor');
77

88
/**
99
* Error handler
@@ -14,7 +14,7 @@ module.exports = function errorHandler(error, message = '', exitCode = 1) {
1414
error = null;
1515
}
1616
message = message || 'Error making replacements';
17-
console.error(chalk.red(message));
17+
console.error(tc.red(message));
1818
if (error) {
1919
console.error(error);
2020
}

lib/helpers/success-handler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
/**
44
* Dependencies
55
*/
6-
const chalk = require('chalk');
6+
const tc = require('turbocolor');
77

88
/**
99
* Success handler
1010
*/
1111
module.exports = function successHandler(changes, verbose = false) {
1212
if (changes.length > 0) {
13-
console.log(chalk.green(changes.length, 'file(s) were changed'));
13+
console.log(tc.green(changes.length, 'file(s) were changed'));
1414
if (verbose) {
15-
changes.forEach(file => console.log(chalk.grey('-', file)));
15+
changes.forEach(file => console.log(tc.gray('-', file)));
1616
}
1717
}
1818
else {
19-
console.log(chalk.yellow('No files were changed'));
19+
console.log(tc.yellow('No files were changed'));
2020
}
2121
};

lib/replace-in-file.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Dependencies
55
*/
6-
const chalk = require('chalk');
6+
const tc = require('turbocolor');
77
const parseConfig = require('./helpers/parse-config');
88
const getPathsSync = require('./helpers/get-paths-sync');
99
const getPathsAsync = require('./helpers/get-paths-async');
@@ -35,7 +35,7 @@ function replaceInFile(config, cb) {
3535
//Dry run?
3636
//istanbul ignore if: No need to test console logs
3737
if (dry && verbose) {
38-
console.log(chalk.yellow('Dry run, not making actual changes'));
38+
console.log(tc.yellow('Dry run, not making actual changes'));
3939
}
4040

4141
//Find paths
@@ -90,7 +90,7 @@ replaceInFile.sync = function(config) {
9090
//Dry run?
9191
//istanbul ignore if: No need to test console logs
9292
if (dry && verbose) {
93-
console.log(chalk.yellow('Dry run, not making any changes'));
93+
console.log(tc.yellow('Dry run, not making any changes'));
9494
}
9595

9696
//Process synchronously

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"coverage": "open -a \"Google Chrome\" ./coverage/lcov-report/index.html"
3232
},
3333
"dependencies": {
34-
"chalk": "^2.3.2",
3534
"glob": "^7.1.2",
35+
"turbocolor": "2.3.0",
3636
"yargs": "^11.0.0"
3737
},
3838
"devDependencies": {

0 commit comments

Comments
 (0)