[nodejs] How to persist collections

2014-02-11 Thread Dev Dan
Hi, I have application in nodejs and I need to load when you start a collection from mongo to in-memory db. then in use only this object, not mongo collection. How to make? It occurred to me: *TasksCollection.coffee* class TasksCollection constructor: (@Tasks, @Datastore) -

[nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Looks like it is not solved. Sometimes I get situation when fs.ReadStrem neither emit 'readable' nor 'end' when used on growing file in non flow mode. And I have no event to resume reading. Except maybe some timeout. 2014-02-08 19:53 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Solved by

[nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Or maybe I understand it wrong. When I call fs.ReadStream.read should I expect it will emit 'end' during call? Ok it is better to look in sources. 2014-02-11 11:27 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Looks like it is not solved. Sometimes I get situation when fs.ReadStrem neither

[nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
This is not funny now. I am not able to make such simple thing. Now I am getting swapped chunks of data. https://gist.github.com/xdenser/8887437 when new read stream starts first 2 chunks of data are swapped. How is it possible? 2014-02-11 11:50 GMT+02:00 Denys Khanzhyiev xden...@gmail.com:

[nodejs] Re: help with streams

2014-02-11 Thread greelgorke
you can count bytes with by putting a passthrough stream in between var counter = new stream.Transform var count = 0 counter._transform = function(chunk, encoding, callback){ count += (chunk chunk.length) || 0 this.push(chunk) callback() }

[nodejs] Re: help with streams

2014-02-11 Thread greelgorke
In Addition to that, whenthe counter can emit something counter._transform = function(chunk, encoding, callback){ count += (chunk chunk.length) || 0 this.push(chunk) if(count = threshhold) this.emit('threshhold_reached') callback() } Am Dienstag, 11. Februar 2014 12:36:20 UTC+1 schrieb

[nodejs] zfs

2014-02-11 Thread Erdoğan Kaya
zfs set compression=lz4 zones how i use zfs set on nodejs ? -- -- 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

[nodejs] Re: Running multiple instances of node.js servers on different ports

2014-02-11 Thread Leonardo Rossi
Hi, What I've done before is create aliases for network interfaces and let different version of the node code (in different paths) listen on one particular alias address rather than the official one. You can see how to create aliases here:

Re: [nodejs] Re: Running multiple instances of node.js servers on different ports

2014-02-11 Thread Arman Didandeh
Thanks to you all. On 11 February 2014 04:30, Leonardo Rossi leonardo.ro...@gmail.com wrote: Hi, What I've done before is create aliases for network interfaces and let different version of the node code (in different paths) listen on one particular alias address rather than the official

[nodejs] nodejs cluster issue with socket.io

2014-02-11 Thread Abramovick
My app was working fine (prior to using nodejs cluster) but after introducing it an error occurs on the client side saying WebSocket connection to 'ws://ip_address/socket.io/1/websocket/92H245FLpYWnG6jF_uK6' failed: WebSocket is closed before the connection is established. I've checked on

[nodejs] callback hell on steroid

2014-02-11 Thread Reza Razavipour
I have a node.js, express really, app that needs to make SOAP calls, asynchronously of course. In this case, I make a soap call and I get a count. Once i have the count, I have to loop and make a series of SOAP calls for each, this part you can think of this as async.series calls. I have used

[nodejs] Where exactly is the error?[Beginner]

2014-02-11 Thread Anurag Prasad
[image: Inline image 1] *Code-* var fs = require('fs'); var sax = require('sax'); parser = sax.parser(true); elements_array = []; nodeCounter = -1; parser.onerror = function(e) { // an error happened. }; parser.onopentag = function(node) { // opened a tag. node has name and

Re: [nodejs] callback hell on steroid

2014-02-11 Thread Mikeal Rogers
http://callbackhell.com/ On Feb 11, 2014, at 10:42AM, Reza Razavipour reza.razavip...@gmail.com wrote: I have a node.js, express really, app that needs to make SOAP calls, asynchronously of course. In this case, I make a soap call and I get a count. Once i have the count, I have to loop

Re: [nodejs] Where exactly is the error?[Beginner]

2014-02-11 Thread Diogo Resende
Your “Code” part does not seem to have any problems, at least a missing “)”. You should really install a linter in your editor, you have unused vars and global pollution.. -- Diogo Resende On Tuesday 11 February 2014 at 19:14 , Anurag Prasad wrote: Code- var fs =

Re: [nodejs] Where exactly is the error?[Beginner]

2014-02-11 Thread Anurag Prasad
I am still not able to figure out what the problem is. On Wed, Feb 12, 2014 at 12:48 AM, Diogo Resende drese...@thinkdigital.ptwrote: Your “Code” part does not seem to have any problems, at least a missing “)”. You should really install a linter in your editor, you have unused vars and

Re: [nodejs] Where exactly is the error?[Beginner]

2014-02-11 Thread // ravi
On Feb 11, 2014, at 2:14 PM, Anurag Prasad aprasad1...@gmail.com wrote: Screen Shot 2014-02-12 at 12.41.30 AM.png I'd suggest installing jshint and passing your code through it. --ravi -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Upgrade application from 0.8.x to 0.10.x

2014-02-11 Thread JVA
Hi all, I've developed quite big application with node 0.8.x series and I would like to upgrade nodejs to 0.10.x release. My question is that is there some easy way to check my application dependencies (package.json -npm packages) if some of them is not compatible with node 0.10.x ? The basic

Re: [nodejs] When is 0.11.x stable?

2014-02-11 Thread Filipe Deschamps
Adam, are you sure? On Sunday, February 9, 2014 8:24:57 PM UTC-2, Adam Reynolds wrote: Of note I believe 0.12 will be the last release before 1.0 On 9 Feb 2014 21:02, Kevin Ingwersen ingwi...@googlemail.comjavascript: wrote: Ohh… I see! Well, thanks you two :) Weird versioning, but still

Re: [nodejs] When is 0.11.x stable?

2014-02-11 Thread Sam Roberts
On Tue, Feb 11, 2014 at 1:25 PM, Filipe Deschamps fili...@gmail.com wrote: Adam, are you sure? On Sunday, February 9, 2014 8:24:57 PM UTC-2, Adam Reynolds wrote: Of note I believe 0.12 will be the last release before 1.0 It is the intention. Whether it is achieved ;-) -- -- Job Board:

Re: [nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Ok I have created simple gist to test this. https://gist.github.com/xdenser/8944752 Just run file and you should see WTF! 49152 WTF! 114688 WTF! 180224 WTF! 245760 ... WTF! 4112384 writeStream finish WTF! 4177920 read Stream Finished if you see just writeStream finish read Stream Finished it

[nodejs] Re: callback hell on steroid

2014-02-11 Thread Bruno Jouhier
There are plenty of solutions that let you program node in sync-style with robust exception handling: CPS transformations: - https://github.com/Sage/streamlinejs - http://maxtaco.github.io/coffee-script/ Coroutines/fibers: - https://github.com/laverdet/node-fibers ES6 Generators

Re: [nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
same v0.10.15 Ubuntu 13.10 on ARMv9 2014-02-11 23:48 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Ok I have created simple gist to test this. https://gist.github.com/xdenser/8944752 Just run file and you should see WTF! 49152 WTF! 114688 WTF! 180224 WTF! 245760 ... WTF! 4112384

[nodejs] Re: callback hell on steroid

2014-02-11 Thread Alexey Petrushin
Yep, you should learn how to use state machine hell instead of callback hell. On Tuesday, 11 February 2014 22:42:18 UTC+4, Reza Razavipour wrote: I have a node.js, express really, app that needs to make SOAP calls, asynchronously of course. In this case, I make a soap call and I get a

Re: [nodejs] Upgrade application from 0.8.x to 0.10.x

2014-02-11 Thread Sam Roberts
On Tue, Feb 11, 2014 at 12:13 PM, JVA juss...@gmail.com wrote: I've developed quite big application with node 0.8.x series and I would like to upgrade nodejs to 0.10.x release. My question is that is there some easy way to check my application dependencies (package.json -npm packages) if some

Re: [nodejs] Re: help with streams

2014-02-11 Thread Michael Hart
Your `writeChunk` call seems a bit fragile with the `setTimeout` there - I commented on the gist. I think a smaller test case might be easier to read/understand what you're trying to achieve. On Wednesday, 12 February 2014 08:48:48 UTC+11, Denys Khanzhiyev wrote: Ok I have created simple

Re: [nodejs] io is not defined

2014-02-11 Thread Ryan Schmidt
I'm not sure what else to suggest. The error message is clear: your server is responding with a 404 not found error when the socket.io client-side JavaScript library is requested; therefore the io object is not defined on the client side. You'll need to figure out why your server is not

Re: [nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Thank you Michael, Yes return is missing before setTimeout. I have updated gist. But that does not change result. https://gist.github.com/xdenser/8944752 I think this is small enough. What I am trying to acheeve is to create CatchStream - a stream reading from growing file, where growing file is