has-color

Detect whether a terminal supports color

npm install has-color
30 257 downloads in the last day
179 197 downloads in the last week
559 173 downloads in the last month

has-color Build Status

Detect whether a terminal supports color.

Used in the terminal color module chalk.

Install

$ npm install --save has-color

Usage

var hasColor = require('has-color');

if (hasColor) {
    console.log('Terminal supports color.');
}

It obeys the --color and --no-color CLI flags.

License

MIT © Sindre Sorhus

npm loves you