Meta tweaks
This commit is contained in:
parent
0e6fecc7f7
commit
797461ee32
2 changed files with 3 additions and 14 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
"description": "Terminal string styling done right",
|
"description": "Terminal string styling done right",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": "chalk/chalk",
|
"repository": "chalk/chalk",
|
||||||
|
"funding": "https://github.com/chalk/chalk?sponsor=1",
|
||||||
"main": "source",
|
"main": "source",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
|
@ -49,7 +50,7 @@
|
||||||
"execa": "^3.2.0",
|
"execa": "^3.2.0",
|
||||||
"import-fresh": "^3.1.0",
|
"import-fresh": "^3.1.0",
|
||||||
"matcha": "^0.7.0",
|
"matcha": "^0.7.0",
|
||||||
"nyc": "^14.1.1",
|
"nyc": "^15.0.0",
|
||||||
"resolve-from": "^5.0.0",
|
"resolve-from": "^5.0.0",
|
||||||
"tsd": "^0.7.4",
|
"tsd": "^0.7.4",
|
||||||
"xo": "^0.25.3"
|
"xo": "^0.25.3"
|
||||||
|
|
|
||||||
14
readme.md
14
readme.md
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
||||||
|
|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
- Expressive API
|
- Expressive API
|
||||||
|
|
@ -24,8 +23,7 @@
|
||||||
- Doesn't extend `String.prototype`
|
- Doesn't extend `String.prototype`
|
||||||
- Clean and focused
|
- Clean and focused
|
||||||
- Actively maintained
|
- Actively maintained
|
||||||
- [Used by ~46,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 1, 2019
|
- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020
|
||||||
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|
@ -33,7 +31,6 @@
|
||||||
$ npm install chalk
|
$ npm install chalk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
@ -107,7 +104,6 @@ console.log(chalk.green('Hello %s'), name);
|
||||||
//=> 'Hello Sindre'
|
//=> 'Hello Sindre'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
### chalk.`<style>[.<style>...](string, [string...])`
|
### chalk.`<style>[.<style>...](string, [string...])`
|
||||||
|
|
@ -149,7 +145,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=
|
||||||
|
|
||||||
`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.
|
`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.
|
||||||
|
|
||||||
|
|
||||||
## Styles
|
## Styles
|
||||||
|
|
||||||
### Modifiers
|
### Modifiers
|
||||||
|
|
@ -202,7 +197,6 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=
|
||||||
- `bgCyanBright`
|
- `bgCyanBright`
|
||||||
- `bgWhiteBright`
|
- `bgWhiteBright`
|
||||||
|
|
||||||
|
|
||||||
## Tagged template literal
|
## Tagged template literal
|
||||||
|
|
||||||
Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
|
Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
|
||||||
|
|
@ -232,7 +226,6 @@ Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain
|
||||||
|
|
||||||
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
|
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
|
||||||
|
|
||||||
|
|
||||||
## 256 and Truecolor color support
|
## 256 and Truecolor color support
|
||||||
|
|
||||||
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
|
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
|
||||||
|
|
@ -262,24 +255,20 @@ The following color models can be used:
|
||||||
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
|
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
|
||||||
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
||||||
|
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
|
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
|
||||||
|
|
||||||
|
|
||||||
## Origin story
|
## Origin story
|
||||||
|
|
||||||
[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.
|
[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.
|
||||||
|
|
||||||
|
|
||||||
## chalk for enterprise
|
## chalk for enterprise
|
||||||
|
|
||||||
Available as part of the Tidelift Subscription.
|
Available as part of the Tidelift Subscription.
|
||||||
|
|
||||||
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)
|
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)
|
||||||
|
|
||||||
|
|
||||||
## Related
|
## Related
|
||||||
|
|
||||||
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
||||||
|
|
@ -297,7 +286,6 @@ The maintainers of chalk and thousands of other packages are working with Tideli
|
||||||
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
||||||
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
||||||
|
|
||||||
|
|
||||||
## Maintainers
|
## Maintainers
|
||||||
|
|
||||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue