Add named exports

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
Richie Bendall 2021-04-17 16:02:17 +12:00
parent fa16f4ec37
commit 5dbc9d54d6
No known key found for this signature in database
GPG key ID: 1C6A99DFA9D306FC
10 changed files with 152 additions and 158 deletions

View file

@ -171,9 +171,9 @@ Color support is automatically detected, but you can override it by setting the
If you need to change this in a reusable module, create a new instance:
```js
import chalk from 'chalk';
import {Chalk} from 'chalk';
const customChalk = new chalk.Instance({level: 0});
const customChalk = new Chalk({level: 0});
```
| Level | Description |
@ -183,7 +183,7 @@ const customChalk = new chalk.Instance({level: 0});
| `2` | 256 color support |
| `3` | Truecolor support (16 million colors) |
### chalk.supportsColor
### supportsColor
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
@ -191,9 +191,9 @@ Can be overridden by the user with the flags `--color` and `--no-color`. For sit
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
### chalk.stderr and chalk.stderr.supportsColor
### chalkStderr and chalkStderr.supportsColor
`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.
`chalkStderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `supportsColor` apply to this too. `chalkStderr.supportsColor` is exposed for convenience.
## Styles