Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions colorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
const colors = require('colors/safe');
const { LEVEL, MESSAGE } = require('triple-beam');

//
// Fix colors not appearing in non-tty environments
//
colors.enabled = true;

/**
* @property {RegExp} hasSpace
* Simple regex to check for presence of spaces.
Expand All @@ -24,6 +19,13 @@ class Colorizer {
this.addColors(opts.colors);
}

//
// Fix colors not appearing in non-tty environments
//
if (opts.force) {
colors.enabled = true;
}

this.options = opts;
}

Expand Down