Is it possible to efficiently get the first record of a JSONL file without consuming the entire stream / file? One way I have been able to inefficiently do so is the following:
curl -s http://example.org/file.jsonl | jq -s '.[0]'
I realize that head
could be used here to extract the first line, but assume that the file may not use a newline as the record separator and may simply be concatenated objects or arrays.