From 6444e365c0e9ab32674d0f42d2a473267225d3e7 Mon Sep 17 00:00:00 2001 From: LitoMore Date: Tue, 4 Oct 2022 20:29:26 +0800 Subject: [PATCH] Updates --- readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 320f036..4cfd4b2 100644 --- a/readme.md +++ b/readme.md @@ -203,12 +203,15 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= ### modifiers, foregroundColors, backgroundColors, and colors -All supported style strings are exposed for convenience. `colors` is the combination of `foregroundColors` and `backgroundColors`. +All supported style strings are exposed as an array of strings for convenience. `colors` is the combination of `foregroundColors` and `backgroundColors`. This is useful when checking if a style string is supported: ```js -import {foregroundColors} from 'chalk'; +import {modifiers, foregroundColors} from 'chalk'; + +console.log(modifiers.includes('bold')); +//=> true console.log(foregroundColors.includes('pink')); //=> false