Closed DeiNile closed 1 month ago
I'm going to revert this. For anyone reading and interested in having this, feel free to propose a solution that addresses https://github.com/websockets/wscat/pull/140#discussion_r1791752256 and https://github.com/websockets/wscat/pull/140#discussion_r1791757317.
It is pretty common to send JSON over websockets, and it can be rather limiting to be forced to "minify" the JSON string, especially for local testing. The new '-j --json' flag is supposed to alleviate that. The primary way this is alleviated is by allowing for multiline inputs. Secondarily, by leveraging the built in
JSON.parse()
method we can check to see if the inputs produce a valid JSON string, and determine that the multiline input is terminated. Finally, as inspired by the Scala REPL, two consecutive empty lines resets the input.Here are some samples of what this looks like while it is running: