Update readme to include chalk.instance instead of constructor
This commit is contained in:
parent
ed509bcf0b
commit
f66f1c09ea
1 changed files with 3 additions and 3 deletions
|
|
@ -140,12 +140,12 @@ Multiple arguments will be separated by space.
|
|||
|
||||
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. When `chalk.enabled` is `true`, `chalk.level` must *also* be greater than `0` for colored output to be produced.
|
||||
|
||||
Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
|
||||
Chalk is enabled by default unless explicitly disabled via `Chalk.instance()` or `chalk.level` is `0`.
|
||||
|
||||
If you need to change this in a reusable module, create a new instance:
|
||||
|
||||
```js
|
||||
const ctx = new chalk.constructor({enabled: false});
|
||||
const ctx = new chalk.instance({enabled: false});
|
||||
```
|
||||
|
||||
### chalk.level
|
||||
|
|
@ -155,7 +155,7 @@ 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
|
||||
const ctx = new chalk.constructor({level: 0});
|
||||
const ctx = new chalk.instance({level: 0});
|
||||
```
|
||||
|
||||
Levels are as follows:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue