Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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 2.3KB

4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. ---
  4. <div align="center">
  5. <b>
  6. <a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
  7. </b>
  8. <br>
  9. <sub>
  10. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  11. </sub>
  12. </div>
  13. ---
  14. ## Install
  15. ```
  16. $ npm install supports-color
  17. ```
  18. ## Usage
  19. ```js
  20. const supportsColor = require('supports-color');
  21. if (supportsColor.stdout) {
  22. console.log('Terminal stdout supports color');
  23. }
  24. if (supportsColor.stdout.has256) {
  25. console.log('Terminal stdout supports 256 colors');
  26. }
  27. if (supportsColor.stderr.has16m) {
  28. console.log('Terminal stderr supports 16 million colors (truecolor)');
  29. }
  30. ```
  31. ## API
  32. Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
  33. The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
  34. - `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
  35. - `.level = 2` and `.has256 = true`: 256 color support
  36. - `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
  37. ## Info
  38. It obeys the `--color` and `--no-color` CLI flags.
  39. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
  40. Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
  41. ## Related
  42. - [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
  43. - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
  44. ## Maintainers
  45. - [Sindre Sorhus](https://github.com/sindresorhus)
  46. - [Josh Junon](https://github.com/qix-)
  47. ## License
  48. MIT