diff --git a/colorize.js b/colorize.js index ba6860e..3c86aff 100644 --- a/colorize.js +++ b/colorize.js @@ -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. @@ -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; }