On Fri, Mar 30, 2012 at 9:07 AM, Dave Clements <[email protected]>wrote:
> Hi all, > > Whenever you read from a data event, each chunk is obviously the size of > the buffer, which means pieces of data can be split between two chunks, > I'm just wondering how other people reconcile data over the chunking chasm > (besides obviously collecting it all first then processing it), > and is there some specifically awesome way or module I've yet to learn of? > > Best to everyone, > > Dave > The de facto pattern for what you're describing is embodied in SAX ( http://en.wikipedia.org/wiki/Simple_API_for_XML). The idea is simple but powerful: emit events on recognition of patterns and attach listeners which do the best they can with the information received so far. Specifically for node, you might have a look at clarinet ( https://github.com/dscape/clarinet) or sax-js ( https://github.com/isaacs/sax-js). -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
