mirror of
https://github.com/garraflavatra/trmclr.git
synced 2025-01-18 03:07:57 +00:00
Add stripColor to readme
This commit is contained in:
parent
8953fdb34e
commit
94bd33c40d
19
README.md
19
README.md
@ -20,9 +20,24 @@ import { cyan, bgMagenta } from 'trmclr';
|
||||
console.log(cyan(bgMagenta('Some text')));
|
||||
```
|
||||
|
||||
## Enable or disable color
|
||||
### Enable or disable color
|
||||
|
||||
By using `setColorEnabled(true)` or `setColorEnabled(false)` you can respectively enable and disable color output. Use `getColorEnabled()` to retrieve the current state.
|
||||
```js
|
||||
import { getColorEnabled, setColorEnabled } from 'trmclr';
|
||||
|
||||
setColorEnabled(true);
|
||||
setColorEnabled(false);
|
||||
|
||||
getColorEnabled(); // → false
|
||||
```
|
||||
|
||||
### Remove colors and decorations
|
||||
|
||||
```js
|
||||
import { cyan, stripColor } from 'trmclr';
|
||||
|
||||
stripColor(cyan('Hi')); // → uncolored "Hi"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user