From: Intransition Date: 2011-09-27T07:33:53+09:00 Subject: Re: JSON equivalent to YAML streams? On Sep 26, 3:24 pm, Brian Candler wrote: > Thomas Sawyer wrote in post #1023829: > > > Is there any such thing as a JSON stream  equivalent to YAML document > > streams? > > What CouchDB does for its continuous changes feed is just to send one > JSON document per line, with a newline terminator. Then you can do: > >   while line = gets >     data = JSON.parse(line) >     ... do something with data >   end > > Of course this means that the JSON you send must not be pretty-printed, > and also any embedded newlines within strings are encoded as \n, which > the JSON spec allows. Awesome. That should work for my case too. If I need the data pretty printed I use YAML anyway. Thanks Brian.