Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/chalk/readme.md

    rd565449 r0c6b92a  
    1010> Terminal string styling done right
    1111
    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>
    1863
    1964## Highlights
     
    2772- Clean and focused
    2873- 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
    3175
    3276## Install
     
    3579$ npm install chalk
    3680```
    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 
    4281
    4382## Usage
     
    114153```
    115154
    116 
    117155## API
    118156
     
    125163Multiple arguments will be separated by space.
    126164
    127 ### chalk.enabled
    128 
    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 Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
     165### chalk.level
     166
     167Specifies the level of color support.
     168
     169Color 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.
    132170
    133171If you need to change this in a reusable module, create a new instance:
    134172
    135173```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)
     174const 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) |
    155183
    156184### chalk.supportsColor
     
    158186Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
    159187
    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 color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
     188Can 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.
    161189
    162190Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
    163191
     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.
    164195
    165196## Styles
     
    167198### Modifiers
    168199
    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.
    178209
    179210### Colors
     
    183214- `green`
    184215- `yellow`
    185 - `blue` *(On Windows the bright version is used since normal blue is illegible)*
     216- `blue`
    186217- `magenta`
    187218- `cyan`
    188219- `white`
    189 - `gray` ("bright black")
     220- `blackBright` (alias: `gray`, `grey`)
    190221- `redBright`
    191222- `greenBright`
     
    206237- `bgCyan`
    207238- `bgWhite`
    208 - `bgBlackBright`
     239- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
    209240- `bgRedBright`
    210241- `bgGreenBright`
     
    215246- `bgWhiteBright`
    216247
    217 
    218248## Tagged template literal
    219249
    220 Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
     250Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
    221251
    222252```js
     
    227257
    228258console.log(chalk`
    229   There are {bold 5280 feet} in a mile.
    230   In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
     259        There are {bold 5280 feet} in a mile.
     260        In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
    231261`);
    232262```
     
    234264Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
    235265
    236 Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
     266Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:
    237267
    238268```js
    239269console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
     270console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
    240271console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
    241272```
     
    244275
    245276All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
    246 
    247277
    248278## 256 and Truecolor color support
     
    271301- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
    272302- [`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')`
    277306
    278307## Windows
    279308
    280 If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`.
    281 
     309If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
    282310
    283311## Origin story
     
    285313[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.
    286314
     315## chalk for enterprise
     316
     317Available as part of the Tidelift Subscription.
     318
     319The 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)
    287320
    288321## Related
     
    303336- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
    304337
    305 
    306338## Maintainers
    307339
    308340- [Sindre Sorhus](https://github.com/sindresorhus)
    309341- [Josh Junon](https://github.com/qix-)
    310 
    311 
    312 ## License
    313 
    314 MIT
Note: See TracChangeset for help on using the changeset viewer.