has-color.js 292 B

123456789101112
  1. 'use strict'
  2. module.exports = isWin32() || isColorTerm()
  3. function isWin32 () {
  4. return process.platform === 'win32'
  5. }
  6. function isColorTerm () {
  7. var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i
  8. return !!process.env.COLORTERM || termHasColor.test(process.env.TERM)
  9. }