#json-parser #json #jq #parser #cli

app livejq

An alternative jq implementation in rust for continuous parsing without crashing on invalid JSON

5 stable releases

1.1.1 Aug 1, 2023
1.0.2 Jul 31, 2023
1.0.1 Jul 30, 2023

#659 in Command line utilities

34 downloads per month

MIT license

6KB
69 lines

LiveJQ

livejq is JSON parser like jq but is designed to work in continuous input without crashing on invalid JSON

User Case

  1. When you have a program that is printing logs which may have other formats in between like text along with JSON, and you want to parse JSON for better readability. You can use livejq to parse JSON without crashing on other formats.

It works on one assumption that the JSON is a single string like '{ "name": "Kunal Singh", "age": 21 }'.

This is a limitation, but will be fixed in future

Demo

https://github.com/KunalSin9h/livejq/assets/82411321/1c9438ed-914a-4026-912a-e85d05d36c70

Install

Install using cargo

cargo install livejq

or you can find binaries in the Release page

Usage

./my_program | livejq

Here | is for piping output of my_program into livejq as input.

Example

example

Dependencies

~360–760KB
~17K SLoC