Changeset 0c6b92a for imaps-frontend/node_modules/chalk/readme.md
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/chalk/readme.md
rd565449 r0c6b92a 10 10 > Terminal string styling done right 11 11 12 [![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) 13 14 ### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) 15 16 <img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900"> 17 12 [![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) 13 14 <img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900"> 15 16 <br> 17 18 --- 19 20 <div align="center"> 21 <p> 22 <p> 23 <sup> 24 Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a> 25 </sup> 26 </p> 27 <sup>Special thanks to:</sup> 28 <br> 29 <br> 30 <a href="https://standardresume.co/tech"> 31 <img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/> 32 </a> 33 <br> 34 <br> 35 <a href="https://retool.com/?utm_campaign=sindresorhus"> 36 <img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/> 37 </a> 38 <br> 39 <br> 40 <a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=chalk&utm_source=github"> 41 <div> 42 <img src="https://dashboard.doppler.com/imgs/logo-long.svg" width="240" alt="Doppler"> 43 </div> 44 <b>All your environment variables, in one place</b> 45 <div> 46 <span>Stop struggling with scattered API keys, hacking together home-brewed tools,</span> 47 <br> 48 <span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span> 49 </div> 50 </a> 51 <br> 52 <a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github"> 53 <div> 54 <img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery"> 55 </div> 56 </a> 57 </p> 58 </div> 59 60 --- 61 62 <br> 18 63 19 64 ## Highlights … … 27 72 - Clean and focused 28 73 - Actively maintained 29 - [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 30 74 - [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 31 75 32 76 ## Install … … 35 79 $ npm install chalk 36 80 ``` 37 38 <a href="https://www.patreon.com/sindresorhus">39 <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">40 </a>41 42 81 43 82 ## Usage … … 114 153 ``` 115 154 116 117 155 ## API 118 156 … … 125 163 Multiple arguments will be separated by space. 126 164 127 ### chalk. enabled128 129 Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.130 131 C halk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.165 ### chalk.level 166 167 Specifies the level of color support. 168 169 Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers. 132 170 133 171 If you need to change this in a reusable module, create a new instance: 134 172 135 173 ```js 136 const ctx = new chalk.constructor({enabled: false}); 137 ``` 138 139 ### chalk.level 140 141 Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers. 142 143 If you need to change this in a reusable module, create a new instance: 144 145 ```js 146 const ctx = new chalk.constructor({level: 0}); 147 ``` 148 149 Levels are as follows: 150 151 0. All colors disabled 152 1. Basic color support (16 colors) 153 2. 256 color support 154 3. Truecolor support (16 million colors) 174 const ctx = new chalk.Instance({level: 0}); 175 ``` 176 177 | Level | Description | 178 | :---: | :--- | 179 | `0` | All colors disabled | 180 | `1` | Basic color support (16 colors) | 181 | `2` | 256 color support | 182 | `3` | Truecolor support (16 million colors) | 155 183 156 184 ### chalk.supportsColor … … 158 186 Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience. 159 187 160 Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable coloror `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.188 Can be overridden by the user with the flags `--color` and `--no-color`. 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. 161 189 162 190 Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. 163 191 192 ### chalk.stderr and chalk.stderr.supportsColor 193 194 `chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience. 164 195 165 196 ## Styles … … 167 198 ### Modifiers 168 199 169 - `reset` 170 - `bold` 171 - `dim` 172 - `italic` *(Not widely supported)*173 - `underline` 174 - `inverse` 175 - `hidden` 176 - `strikethrough` *(Not widely supported)*177 - `visible` (Text is emitted only if enabled)200 - `reset` - Resets the current color chain. 201 - `bold` - Make text bold. 202 - `dim` - Emitting only a small amount of light. 203 - `italic` - Make text italic. *(Not widely supported)* 204 - `underline` - Make text underline. *(Not widely supported)* 205 - `inverse`- Inverse background and foreground colors. 206 - `hidden` - Prints the text, but makes it invisible. 207 - `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)* 208 - `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic. 178 209 179 210 ### Colors … … 183 214 - `green` 184 215 - `yellow` 185 - `blue` *(On Windows the bright version is used since normal blue is illegible)*216 - `blue` 186 217 - `magenta` 187 218 - `cyan` 188 219 - `white` 189 - ` gray` ("bright black")220 - `blackBright` (alias: `gray`, `grey`) 190 221 - `redBright` 191 222 - `greenBright` … … 206 237 - `bgCyan` 207 238 - `bgWhite` 208 - `bgBlackBright` 239 - `bgBlackBright` (alias: `bgGray`, `bgGrey`) 209 240 - `bgRedBright` 210 241 - `bgGreenBright` … … 215 246 - `bgWhiteBright` 216 247 217 218 248 ## Tagged template literal 219 249 220 Chalk can be used as a [tagged template literal](http ://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).250 Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals). 221 251 222 252 ```js … … 227 257 228 258 console.log(chalk` 229 230 259 There are {bold 5280 feet} in a mile. 260 In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}. 231 261 `); 232 262 ``` … … 234 264 Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`). 235 265 236 Template styles are chained exactly like normal Chalk styles. The following t wostatements are equivalent:266 Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent: 237 267 238 268 ```js 239 269 console.log(chalk.bold.rgb(10, 100, 200)('Hello!')); 270 console.log(chalk.bold.rgb(10, 100, 200)`Hello!`); 240 271 console.log(chalk`{bold.rgb(10,100,200) Hello!}`); 241 272 ``` … … 244 275 245 276 All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped. 246 247 277 248 278 ## 256 and Truecolor color support … … 271 301 - [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')` 272 302 - [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')` 273 - [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')` 274 - `ansi16` 275 - `ansi256` 276 303 - [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')` 304 - [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')` 305 - [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')` 277 306 278 307 ## Windows 279 308 280 If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`. 281 309 If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`. 282 310 283 311 ## Origin story … … 285 313 [colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative. 286 314 315 ## chalk for enterprise 316 317 Available as part of the Tidelift Subscription. 318 319 The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) 287 320 288 321 ## Related … … 303 336 - [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal 304 337 305 306 338 ## Maintainers 307 339 308 340 - [Sindre Sorhus](https://github.com/sindresorhus) 309 341 - [Josh Junon](https://github.com/qix-) 310 311 312 ## License313 314 MIT
Note:
See TracChangeset
for help on using the changeset viewer.