diff --git a/index.js b/index.js index 21778ae..8b4e991 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ const dargs = require('dargs'); const execa = require('execa'); const PluginError = require('plugin-error'); +const supportsColor = require('supports-color'); const through = require('through2'); // TODO: Use execa localDir option when available const npmRunPath = require('npm-run-path'); @@ -16,7 +17,7 @@ const MULTIPLE_OPTS = new Set([ module.exports = opts => { opts = Object.assign({ - colors: true, + colors: Boolean(supportsColor.stdout), suppress: false }, opts); diff --git a/package.json b/package.json index b6951d6..47aeded 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "mocha": "^5.2.0", "npm-run-path": "^2.0.2", "plugin-error": "^0.1.2", + "supports-color": "^5.4.0", "through2": "^2.0.3" }, "devDependencies": {