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

Question - Is there any way to use .pipe() in NodeJS with prettyjson #18

Open
paulwehner opened this issue Jul 20, 2015 · 2 comments
Open

Comments

@paulwehner
Copy link

So for example could I do something like:

var file = fs.createReadStream('dogs.json');
file.pipe(prettyjson.render).pipe(response);
@rafeca
Copy link
Owner

rafeca commented Aug 9, 2015

Using streams is not currently supported, as prettyjson decodes the whole JSON data at once.

Something similar to reading the process stdin could be done for streams.

@tjconcept
Copy link

tjconcept commented Aug 25, 2016

I guess this is related to support stdin output that is separated by newlines (such as JSONStream.stringify(false))?

Would be a great feature :-)

A current workaround using the JSONStream package: JSONStream < data.njs | prettyjson.

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