Detect whether a terminal supports color
JavaScript
Latest commit eeeaaf1 Aug 24, 2015 @sindresorhus sindresorhus add XO
Permalink
Failed to load latest commit information.
.editorconfig init Jun 30, 2015
.gitattributes init Jun 30, 2015
.gitignore init Jun 30, 2015
.travis.yml init Jun 30, 2015
cli.js add XO Aug 24, 2015
license init Jun 30, 2015
package.json add XO Aug 24, 2015
readme.md minor tweaks to the help output Jul 25, 2015
test.js init Jun 30, 2015

readme.md

supports-color-cli Build Status

Detect whether a terminal supports color

Install

$ npm install --global supports-color-cli

Usage

$ supports-color --help

  Usage
    $ supports-color [--<256|16m>]

  Options
    --256   Check for 256 color support
    --16m   Check for 16 million color support (True Color)

  Examples
    $ supports-color
    $ supports-color --256
    $ supports-color --16m

  Exits with code 0 if color is supported and 1 if not

You can force color by setting the environment variable FORCE_COLOR to any value.

Related

License

MIT © Sindre Sorhus