6 ms·
Is there an option for it to read the contents from a pipe? that's by far my biggest use for the jq app.
by polshaw 9mo ago
Is there an option for it to read the contents from a pipe? that's by far my biggest use for the jq app.
- tuetuopay 9mo agothis would be amazing to be chained with jq, that was my first thought as well.
- simonw 9mo agoThere's a C# CLI app in the repo: https://github.com/j-brooke/FracturedJson/blob/main/FracturedJsonCli/Cli.cs https://github.com/j-brooke/FracturedJson/blob/main/Fracture... Output is to standard out, or a file specified by the --outfile switch. Input is from either standard in, or from a file if using the --file switch It looks like both the JavaScript version and the new Python C# wrapper have equivalent CLI tools as well.
- staticshock 9mo agoI don't see a CLI tool in the Typescript repo.
- simonw 9mo agoHuh, you're right - could have sworn I saw one but I must have been mistaken.
- deleted 9mo ago[deleted]
- pimlottc 9mo agoYou can (usually) specify the input file name as “-“ (single hyphen) to read from stdin
- mlegendre 9mo agoOr you can use `/dev/stdin`, which has the upside of not needing tool support. I somewhat regularly use this on Linux. I think it also works on OS X
- mlegendre 9mo agoAnd conversely, `/dev/stdout` (resp. `/dev/stderr`) is a convenient way to "redirect" output to stdout (resp stderr) instead of a file
- ruuda 9mo agoRCL (https://github.com/ruuda/rcl https://github.com/ruuda/rcl) pretty-prints its output by default. Pipe to `rcl e` to pretty-print RCL (which has slightly lighter key-value syntax, good if you only want to inspect it), while `rcl je` produces json output. It doesn’t align tables like FracturedJson, but it does format values on a single line where possible. The pretty printer is based on the classic A Prettier Printer by Philip Wadler; the algorithm is quite elegant. Any value will be formatted wide if it fits the target width, otherwise tall.
- vhcr 9mo agoI don't know, but you can always use <() process substitution to create a temp file.