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 9.0KB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. # ansi-colors [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM monthly downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![NPM total downloads](https://img.shields.io/npm/dt/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Linux Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/ansi-colors) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/ansi-colors.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/ansi-colors)
  2. > Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).
  3. Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support.
  4. ## Install
  5. Install with [npm](https://www.npmjs.com/):
  6. ```sh
  7. $ npm install --save ansi-colors
  8. ```
  9. ![image](https://user-images.githubusercontent.com/383994/39635445-8a98a3a6-4f8b-11e8-89c1-068c45d4fff8.png)
  10. ## Why use this?
  11. ansi-colors is _the fastest Node.js library for terminal styling_. A more performant drop-in replacement for chalk, with no dependencies.
  12. * _Blazing fast_ - Fastest terminal styling library in node.js, 10-20x faster than chalk!
  13. * _Drop-in replacement_ for [chalk](https://github.com/chalk/chalk).
  14. * _No dependencies_ (Chalk has 7 dependencies in its tree!)
  15. * _Safe_ - Does not modify the `String.prototype` like [colors](https://github.com/Marak/colors.js).
  16. * Supports [nested colors](#nested-colors), **and does not have the [nested styling bug](#nested-styling-bug) that is present in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur)**.
  17. * Supports [chained colors](#chained-colors).
  18. * [Toggle color support](#toggle-color-support) on or off.
  19. ## Usage
  20. ```js
  21. const c = require('ansi-colors');
  22. console.log(c.red('This is a red string!'));
  23. console.log(c.green('This is a red string!'));
  24. console.log(c.cyan('This is a cyan string!'));
  25. console.log(c.yellow('This is a yellow string!'));
  26. ```
  27. ![image](https://user-images.githubusercontent.com/383994/39653848-a38e67da-4fc0-11e8-89ae-98c65ebe9dcf.png)
  28. ## Chained colors
  29. ```js
  30. console.log(c.bold.red('this is a bold red message'));
  31. console.log(c.bold.yellow.italic('this is a bold yellow italicized message'));
  32. console.log(c.green.bold.underline('this is a bold green underlined message'));
  33. ```
  34. ![image](https://user-images.githubusercontent.com/383994/39635780-7617246a-4f8c-11e8-89e9-05216cc54e38.png)
  35. ## Nested colors
  36. ```js
  37. console.log(c.yellow(`foo ${c.red.bold('red')} bar ${c.cyan('cyan')} baz`));
  38. ```
  39. ![image](https://user-images.githubusercontent.com/383994/39635817-8ed93d44-4f8c-11e8-8afd-8c3ea35f5fbe.png)
  40. ### Nested styling bug
  41. `ansi-colors` does not have the nested styling bug found in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur).
  42. ```js
  43. const { bold, red } = require('ansi-styles');
  44. console.log(bold(`foo ${red.dim('bar')} baz`));
  45. const colorette = require('colorette');
  46. console.log(colorette.bold(`foo ${colorette.red(colorette.dim('bar'))} baz`));
  47. const kleur = require('kleur');
  48. console.log(kleur.bold(`foo ${kleur.red.dim('bar')} baz`));
  49. const chalk = require('chalk');
  50. console.log(chalk.bold(`foo ${chalk.red.dim('bar')} baz`));
  51. ```
  52. **Results in the following**
  53. (sans icons and labels)
  54. ![image](https://user-images.githubusercontent.com/383994/47280326-d2ee0580-d5a3-11e8-9611-ea6010f0a253.png)
  55. ## Toggle color support
  56. Easily enable/disable colors.
  57. ```js
  58. const c = require('ansi-colors');
  59. // disable colors manually
  60. c.enabled = false;
  61. // or use a library to automatically detect support
  62. c.enabled = require('color-support').hasBasic;
  63. console.log(c.red('I will only be colored red if the terminal supports colors'));
  64. ```
  65. ## Strip ANSI codes
  66. Use the `.unstyle` method to strip ANSI codes from a string.
  67. ```js
  68. console.log(c.unstyle(c.blue.bold('foo bar baz')));
  69. //=> 'foo bar baz'
  70. ```
  71. ## Available styles
  72. **Note** that bright and bright-background colors are not always supported.
  73. | Colors | Background Colors | Bright Colors | Bright Background Colors |
  74. | ------- | ----------------- | ------------- | ------------------------ |
  75. | black | bgBlack | blackBright | bgBlackBright |
  76. | red | bgRed | redBright | bgRedBright |
  77. | green | bgGreen | greenBright | bgGreenBright |
  78. | yellow | bgYellow | yellowBright | bgYellowBright |
  79. | blue | bgBlue | blueBright | bgBlueBright |
  80. | magenta | bgMagenta | magentaBright | bgMagentaBright |
  81. | cyan | bgCyan | cyanBright | bgCyanBright |
  82. | white | bgWhite | whiteBright | bgWhiteBright |
  83. | gray | | | |
  84. | grey | | | |
  85. _(`gray` is the U.S. spelling, `grey` is more commonly used in the Canada and U.K.)_
  86. ### Style modifiers
  87. * dim
  88. * **bold**
  89. * hidden
  90. * _italic_
  91. * underline
  92. * inverse
  93. * ~~strikethrough~~
  94. * reset
  95. ## Performance
  96. **Libraries tested**
  97. * ansi-colors v3.0.4
  98. * chalk v2.4.1
  99. ### Mac
  100. > MacBook Pro, Intel Core i7, 2.3 GHz, 16 GB.
  101. **Load time**
  102. Time it takes to load the first time `require()` is called:
  103. * ansi-colors - `1.915ms`
  104. * chalk - `12.437ms`
  105. **Benchmarks**
  106. ```
  107. # All Colors
  108. ansi-colors x 173,851 ops/sec ±0.42% (91 runs sampled)
  109. chalk x 9,944 ops/sec ±2.53% (81 runs sampled)))
  110. # Chained colors
  111. ansi-colors x 20,791 ops/sec ±0.60% (88 runs sampled)
  112. chalk x 2,111 ops/sec ±2.34% (83 runs sampled)
  113. # Nested colors
  114. ansi-colors x 59,304 ops/sec ±0.98% (92 runs sampled)
  115. chalk x 4,590 ops/sec ±2.08% (82 runs sampled)
  116. ```
  117. ### Windows
  118. > Windows 10, Intel Core i7-7700k CPU @ 4.2 GHz, 32 GB
  119. **Load time**
  120. Time it takes to load the first time `require()` is called:
  121. * ansi-colors - `1.494ms`
  122. * chalk - `11.523ms`
  123. **Benchmarks**
  124. ```
  125. # All Colors
  126. ansi-colors x 193,088 ops/sec ±0.51% (95 runs sampled))
  127. chalk x 9,612 ops/sec ±3.31% (77 runs sampled)))
  128. # Chained colors
  129. ansi-colors x 26,093 ops/sec ±1.13% (94 runs sampled)
  130. chalk x 2,267 ops/sec ±2.88% (80 runs sampled))
  131. # Nested colors
  132. ansi-colors x 67,747 ops/sec ±0.49% (93 runs sampled)
  133. chalk x 4,446 ops/sec ±3.01% (82 runs sampled))
  134. ```
  135. ## About
  136. <details>
  137. <summary><strong>Contributing</strong></summary>
  138. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
  139. </details>
  140. <details>
  141. <summary><strong>Running Tests</strong></summary>
  142. Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
  143. ```sh
  144. $ npm install && npm test
  145. ```
  146. </details>
  147. <details>
  148. <summary><strong>Building docs</strong></summary>
  149. _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
  150. To generate the readme, run the following command:
  151. ```sh
  152. $ npm install -g verbose/verb#dev verb-generate-readme && verb
  153. ```
  154. </details>
  155. ### Related projects
  156. You might also be interested in these projects:
  157. * [ansi-wrap](https://www.npmjs.com/package/ansi-wrap): Create ansi colors by passing the open and close codes. | [homepage](https://github.com/jonschlinkert/ansi-wrap "Create ansi colors by passing the open and close codes.")
  158. * [strip-color](https://www.npmjs.com/package/strip-color): Strip ANSI color codes from a string. No dependencies. | [homepage](https://github.com/jonschlinkert/strip-color "Strip ANSI color codes from a string. No dependencies.")
  159. ### Contributors
  160. | **Commits** | **Contributor** |
  161. | --- | --- |
  162. | 38 | [jonschlinkert](https://github.com/jonschlinkert) |
  163. | 38 | [doowb](https://github.com/doowb) |
  164. | 6 | [lukeed](https://github.com/lukeed) |
  165. | 2 | [Silic0nS0ldier](https://github.com/Silic0nS0ldier) |
  166. | 1 | [dwieeb](https://github.com/dwieeb) |
  167. | 1 | [jorgebucaran](https://github.com/jorgebucaran) |
  168. | 1 | [madhavarshney](https://github.com/madhavarshney) |
  169. | 1 | [Weishi93](https://github.com/Weishi93) |
  170. | 1 | [chapterjason](https://github.com/chapterjason) |
  171. ### Author
  172. **Brian Woodward**
  173. * [GitHub Profile](https://github.com/doowb)
  174. * [Twitter Profile](https://twitter.com/doowb)
  175. * [LinkedIn Profile](https://linkedin.com/in/woodwardbrian)
  176. ### License
  177. Copyright © 2018, [Brian Woodward](https://github.com/doowb).
  178. Released under the [MIT License](LICENSE).
  179. ***
  180. _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on December 03, 2018._