-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util.styleText(): Combining multiple styles in a single string? #52035
Labels
feature request
Issues that request new features to be added to Node.js.
util
Issues and PRs related to the built-in util module.
Comments
rauschma
added
the
feature request
Issues that request new features to be added to Node.js.
label
Mar 10, 2024
what about passing an array? util.styleText(['bold', 'red'], 'Bold and red!') |
Good idea! Same pros and autocomplete works. |
rdw-msft
pushed a commit
to rdw-msft/node
that referenced
this issue
Mar 26, 2024
PR-URL: nodejs#52040 Fixes: nodejs#52035 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Seems like we need also to add types to |
Work is in progress -> #69212 |
jcbhmr
pushed a commit
to jcbhmr/node
that referenced
this issue
May 15, 2024
PR-URL: nodejs#52040 Fixes: nodejs#52035 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature request
Issues that request new features to be added to Node.js.
util
Issues and PRs related to the built-in util module.
What is the problem this feature will solve?
Currently, using multiple styles with util.styleText() is slightly verbose:
What is the feature you are proposing to solve the problem?
Maybe multiple styles per
format
string could be supported – e.g.:Downside: It would make autocomplete in IDEs less straightforward if not impossible.
The text was updated successfully, but these errors were encountered: