has-color

Detect whether a terminal supports color

MIT 9 个版本
安装
npm install has-color
yarn add has-color
pnpm add has-color
bun add has-color
README

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

版本列表
0.2.0 2018-03-24
0.1.7 2014-04-16
0.1.6 2014-04-11
0.1.5 2014-04-07
0.1.4 2014-02-08
0.1.3 2014-01-29
0.1.2 2014-01-03
0.1.1 2013-08-03
0.1.0 2013-08-03