Skip to content

Support streaming for ndjson input #2510

@Wikiwix

Description

@Wikiwix

yq is able to stream input if there are --- document separators between documents.

As yq by now supports ndjson as --input-format, it would be nice to be able to stream this input as well.

Mnimal example

echo '{"a":1}' >test.json

# This streams a new document every second already
bash -c 'while true; do sleep 1; echo "---"; cat test.json; done' | yq . -

# This does not output anything because yq apparently does not stream the ndjson input
# Ideally it would also stream going forward
bash -c 'while true; do sleep 1; cat test.json; done' | yq --output-format=json . -

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions