Skip to content
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

Add .visible() #192

Closed
Qix- opened this issue Jul 31, 2017 · 1 comment · Fixed by #222
Closed

Add .visible() #192

Qix- opened this issue Jul 31, 2017 · 1 comment · Fixed by #222

Comments

@Qix-
Copy link
Member

Qix- commented Jul 31, 2017

Just ran into the use case where it'd be quite useful to have something like chalk.visible(...), where the contents are only emitted if chalk is enabled and has a non-zero level.

This is particularly for borders and whatnot that are purely cosmetic and thus don't need to even appear if chalk is not outputting things.

In the event chalk is disabled, a call to visible() returns an empty string.

Thoughts?

@sindresorhus
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants