Skip to content

Commit

Permalink
Fix: Make behavior consistent in node 10
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 29, 2018
1 parent dea87db commit d7a1445
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions index.js
@@ -1,8 +1,23 @@
'use strict';

var Console = require('console').Console;
var gray = require('ansi-gray');
var timestamp = require('time-stamp');
var supportsColor = require('color-support');
var nodeVersion = require('parse-node-version')(process.version);

// Needed to add this because node 10 decided to start coloring log output randomly
var console;
if (nodeVersion.major >= 10) {
// Node 10 also changed the way this is constructed
console = new Console({
stdout: process.stdout,
stderr: process.stderr,
colorMode: false,
});
} else {
console = new Console(process.stdout, process.stderr);
}

function hasFlag(flag) {
return (process.argv.indexOf('--' + flag) !== -1);
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -27,6 +27,7 @@
"dependencies": {
"ansi-gray": "^0.1.1",
"color-support": "^1.1.3",
"parse-node-version": "^1.0.0",
"time-stamp": "^1.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit d7a1445

Please sign in to comment.