jwalk icon indicating copy to clipboard operation
jwalk copied to clipboard

Allow to pipe in

Open gunar opened this issue 8 years ago • 1 comments

Hi! Thanks for this tool.

I'd love to be able to pipe data to it. e.g. cat file.json | jwalk

Thanks in advance, Gunar.

gunar avatar Mar 02 '17 00:03 gunar

Hi Gunar,

You asked this nearly a year ago now, but I have a workaround I use for this.

Since the first word after pipes will be expanded as possible aliases, you can use an alias to emulate this behavior:

alias jpipewalk='cat >/tmp/test.json && jwalk /tmp/test.json' 
    alias jpw=jpipewalk

That way, when I have a pipe which produces json, I can just tack | jpw onto the end of it, and voilà, I have an instance of jwalk from the streamed-in data.

To handle stdin functionality really, as pipes are intended, would mean you'd have to handle UI interactions where the data has not necessarily been serialized/streamed-in, and that would be an inordinate amount of work for a utility which is really just good for off-the-cuff introspection of a dataset you're trying to make use of. So, this workaround is probably sufficient.

dougpagani avatar Jan 23 '18 15:01 dougpagani