diff options
Diffstat (limited to 'deps/npm/lib/npm.js')
-rw-r--r-- | deps/npm/lib/npm.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index db3559a384..966d11210c 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -232,7 +232,7 @@ const npm = module.exports = new class extends EventEmitter { process.emit('timeEnd', 'npm:load:setTitle') process.emit('time', 'npm:load:setupLog') - this.color = setupLog(this.config) + setupLog(this.config) process.emit('timeEnd', 'npm:load:setupLog') process.env.COLOR = this.color ? '1' : '0' @@ -261,6 +261,12 @@ const npm = module.exports = new class extends EventEmitter { return flat } + get color () { + // This is a special derived value that takes into consideration not only + // the config, but whether or not we are operating in a tty. + return this.flatOptions.color + } + get lockfileVersion () { return 2 } |