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

How to disable stringifying? #13

Open
aksperiod opened this issue Jul 2, 2019 · 3 comments
Open

How to disable stringifying? #13

aksperiod opened this issue Jul 2, 2019 · 3 comments

Comments

@aksperiod
Copy link

Hey, I love this library, however in some cases I would like to output the javascript object without stringifying. How can this be done? Thanks!

@xpl
Copy link
Owner

xpl commented Jul 3, 2019

Hmm, not sure what you meant by that. As objects have to be stringified in some way before they could be displayed in text :) You mean, stringify without formatting? Or use a default stringifier (like util.inspect from Node)?

Can you provide an example of what you're trying to get?

@aksperiod
Copy link
Author

Currently I am using the library on the client-side to make my console.logs cleaner when I view the browser's javascript console. However, in some cases (i.e. fetchComments().then(console.log)) I am logging large arrays of objects and I prefer to use the default browser functionality where I can click on object properties to expand various sections. Does this make sense? Maybe this is not what the library is meant for?

@xpl
Copy link
Owner

xpl commented Jul 3, 2019

@aksperiod Yeah, that makes sense, as I thought you were using it with Node.

Currently I don't think it's possible to have objects expandable in browser's console, as internally in the library everything is squashed to text before it gets to console.log, and there might be no easy way to change it in a way that would allow passing the original objects down the pipeline...

I will think on that, as that would be a definitely useful feature (as Chrome's console.log does remarkably good job on rendering objects nowadays) — but I cannot promise that it will be implemented anytime soon.

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

2 participants