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

colored JSON Ouput #21

Closed
thomasfr opened this issue Feb 1, 2012 · 2 comments
Closed

colored JSON Ouput #21

thomasfr opened this issue Feb 1, 2012 · 2 comments

Comments

@thomasfr
Copy link

thomasfr commented Feb 1, 2012

This is a feature request.

add a function for coloring a valid json string. Otherwise just return it as it is.

So when doing console.log('{"foo":"bar"}'.highlightJson); the json string gets printed nicely colored.

@cjc
Copy link
Contributor

cjc commented Feb 4, 2012

@thomasfr would the built in util.inspect(JSON.parse('{"foo":"bar"}'),false, null, true) json pretty printing fit your needs?

As a user of colors.js, more general JSON highlighting sounds like a really heavy thing to add to colors.js. Seems like a job for a separate lib.

@Marak
Copy link
Owner

Marak commented Jan 5, 2013

@cjc is right. Doesn't make sense to add this to colors library.

@Marak Marak closed this as completed Jan 5, 2013
mearns added a commit to mearns/colors.js that referenced this issue Sep 13, 2018
As mentioned [here](Marak#240 (comment)), there's a potential
conflict between FORCE_COLOR and FORCE_NO_COLOR. Decided to address this by issuing a warning (when supported)
and falling back on FORCE_COLOR, since that's will preserve existing behavior.
mearns added a commit to mearns/colors.js that referenced this issue Sep 13, 2018
DABH added a commit that referenced this issue Sep 26, 2018
#21 Add support for FORCE_NO_COLOR env var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants