Hi, Thanks to all of you for your answers.
I gave a try, the results is in this commit : https://github.com/nfroidure/VarStream/commit/89a14f237d5f3b4046df4a92770a4e77cdbd680a The example given by dominic now runs like proves this tests : https://github.com/nfroidure/VarStream/commit/4e6a5802504d7a86f8dc607944148163fd2953cd Would be nice if you could review it cause i'm not sure i done it the right way. Have a nice day Le mercredi 11 juillet 2012 08:19:00 UTC+2, Dominic a écrit : > > you should adapt this to follow the node.js stream api. > nodejs.org/api/stream.html > > then it'll be a lot more useful because it will be compatible with > every sort of io module in node. for example, then you'd be able to > just do this: > read from a file: > var scope = {} > fs.createReadStream(file).pipe(new VarStream(scope, true)) > .on('end', function () {console.log(scope)}) > > or write to a file > > new VarStream(scope).pipe(fs.createWriteStream(file)) > > unfortunately, most websocket libraries do not follow the node.js > stream api (YET!). > but here is one: https://github.com/substack/shoe > > > On Tue, Jul 10, 2012 at 4:18 AM, Nicolas FROIDURE > <nicolas....@gmail.com <javascript:>> wrote: > > A small message to inform you of the creations of a new module called > > VarStream and recently published in npm. > > > > The idea behind VarStream is to linearize variables to be able to read > them > > inside a stream sequentially instead of wait the datas to be fully > loaded > > like with JSON or XML. It also allows to merge multiple stream sources > for > > more flexibility. > > > > VarStream is also human readable, allowing to use it as a configuration > and > > localization file format. > > > > Here is the repository : https://github.com/nfroidure/VarStream > > Here is a proof of concept use case that use VarStreams to synchronize > > variables beetween clients using web sockets : > > https://github.com/nfroidure/WebSockIPC > > > > I would like to have advices on VarStreams and pull requests since i'm > new > > to NodeJS, it probably needs some improvements. > > > > -- > > 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 nod...@googlegroups.com<javascript:> > > To unsubscribe from this group, send email to > > nodejs+un...@googlegroups.com <javascript:> > > For more options, visit this group at > > http://groups.google.com/group/nodejs?hl=en?hl=en > -- 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 nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en