Subject: [Json] JSON text sequences in node

From: "Joe Hildebrand (jhildebr)" <[email-masked]>
Date: Tue, 23 Sep 2014 17:15:12 +0000

To prove to myself that the current draft makes sense, doesn't have any 
special casing, and that I hadn't missed anything, I whipped up a quick 
nodejs/coffeescript implementation.

The parser was trivial:

    @_stream = new DelimitStream('\x1e')
      .on 'data', (d) ->
        # if the entry doesn't end with \n, it got truncated
        if d[d.length - 1] != 0x0a
          that.emit 'truncated', d
        else
          try
            j = JSON.parse d
            that.emit 'json', j
            that.push j
          catch error
            that.emit 'invalid', d

The generator isn't interesting enough to talk about.  There's tests, 
docs, coverage metrics and whatnot for some reason.

https://github.com/hildjj/json-text-sequence

-- 
Joe Hildebrand