# has-color

> Detect whether a terminal supports color

Latest version **0.2.0** (published 2018-03-24) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install has-color
pnpm add has-color
yarn add has-color
bun add has-color
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-03-24 |
| First published | 2013-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 371 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | color, colour, colors, terminal, console, cli, ansi, styles, tty, rgb, 256, shell, xterm, command-line, support, capability, detect |

## Links

- npm: https://www.npmjs.com/package/has-color
- Repository: https://github.com/sindresorhus/has-color
- Homepage: https://github.com/sindresorhus/has-color#readme
- Issues: https://github.com/sindresorhus/has-color/issues
- npm.io page: https://npm.io/package/has-color

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.2.0 (latest) — 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

## README

# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color)

> Detect whether a terminal supports color.

Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk).


## Install

```bash
$ npm install --save has-color
```


## Usage

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

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

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


## License

[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com)

---
_Source: https://npm.io/package/has-color · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
