Skip to content

limactl ls --json emits a stream of objects instead of an array #392

Answered by AkihiroSuda
jandubois asked this question in Q&A
Discussion options

You must be logged in to vote

I prefer to use NDJSON (aka JSONlines, LDJSON) everywhere because

  • Memory efficient for marshaling large arrays (limactl ls does not need to scale for more than 10 elements, though)
  • Even if the process crashed, we can get some partial results
  • Friendly to shell utilities such as grep. No need to install gron/ungron.

NDJSON is also used in the event API of the guestagent and the hostagent.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by AkihiroSuda
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #109 on November 06, 2021 04:51.