From 94bd33c40d50a8b13cde52fe4b08a51aa9b89790 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Fri, 9 Aug 2024 15:01:08 +0200 Subject: [PATCH] Add stripColor to readme --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8065da4..19635ce 100644 --- a/README.md +++ b/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