You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 823B

123456789101112131415161718192021222324252627282930313233343536
  1. # supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
  2. > Detect whether a terminal supports color
  3. ## Install
  4. ```
  5. $ npm install --save supports-color
  6. ```
  7. ## Usage
  8. ```js
  9. var supportsColor = require('supports-color');
  10. if (supportsColor) {
  11. console.log('Terminal supports color');
  12. }
  13. ```
  14. It obeys the `--color` and `--no-color` CLI flags.
  15. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
  16. ## Related
  17. - [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
  18. - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
  19. ## License
  20. MIT © [Sindre Sorhus](http://sindresorhus.com)