"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/has-color/index.js" (7 Feb 2017, 536 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict';
    2 module.exports = (function () {
    3     if (process.argv.indexOf('--no-color') !== -1) {
    4         return false;
    5     }
    6 
    7     if (process.argv.indexOf('--color') !== -1) {
    8         return true;
    9     }
   10 
   11     if (process.stdout && !process.stdout.isTTY) {
   12         return false;
   13     }
   14 
   15     if (process.platform === 'win32') {
   16         return true;
   17     }
   18 
   19     if ('COLORTERM' in process.env) {
   20         return true;
   21     }
   22 
   23     if (process.env.TERM === 'dumb') {
   24         return false;
   25     }
   26 
   27     if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
   28         return true;
   29     }
   30 
   31     return false;
   32 })();