Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Isaac Schlueter
On Tue, Jan 22, 2013 at 7:00 PM, Austin William Wright diamondma...@users.sourceforge.net wrote: On the contrary, what sort of project could Node.js be if everyone actually cared about doing things the objectively correct way. Objectively correct? Wow. Node programs run on filesystems. Every

Re: [nodejs] Re: How to detect if file is text or binary using Nodejs?

2013-01-23 Thread greelgorke
it's a kind of magic! cool thing Am Dienstag, 22. Januar 2013 17:51:19 UTC+1 schrieb Nathan Rajlich: Perhaps try node-mmmagic: https://github.com/mscdex/mmmagic On Tue, Jan 22, 2013 at 6:14 AM, greelgorke greel...@gmail.comjavascript: wrote: may be this can help you too

Re: [nodejs] Re: Data validation

2013-01-23 Thread Jake Verbaten
validation and ensuring global constraints are met at the database layer are two completely seperate things. One validates that a piece of data is valid and sanitized by some local constraint. The other checks global constraints across your entire system. Why would you want to split these up?

Re: [nodejs] [Idea]: npm as a dependancy injector.

2013-01-23 Thread Jake Verbaten
Don't build a complex DI system just to enable testing, that's madness. commonJS and require is great. If you really must swap out the dependencies loaded through require for testing purposes then use a mocking tool to do just that For example https://github.com/Colingo/mock which is different

[nodejs] Re: how to end request and retry - after getting response close

2013-01-23 Thread greelgorke
put your oa.get call in your recursive function, then you can call recursive function in on close handler, this should work. a retry request is just another request, at least in http. Am Mittwoch, 23. Januar 2013 03:11:02 UTC+1 schrieb am_p1: Node and js noobie here so if there's a simple fix

[nodejs] Re: Tips on testing internals w/ mocha

2013-01-23 Thread greelgorke
depending on what you actually test you might try sinonjs. its a stub/spy/mock framework. you could mock your internals and preprogram expected behavior. i.E. function A, then function B then function C 3 times etc. http://sinonjs.org/docs/#mocks Am Mittwoch, 23. Januar 2013 05:34:18 UTC+1

Re: [nodejs] Re: Data validation

2013-01-23 Thread greelgorke
just 2 cents: guys, please don't mix up validity and conformity to business rules. sometimes it's hard to not to mix them up, but it is important doe distinguish. That a form field should be an email address is the first one, that this address should be unique in the system, is the other

[nodejs] Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Ket
Hi, I'm just wondering why I cannot send a binary data larger than 64k bytes. And by 64k bytes I mean 64 x 1024 = 65,536 bytes. Thank you -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message

Re: [nodejs] Re: suggestions for API tests

2013-01-23 Thread John Rellis
Thanks folks! I'll try them this evening and see how I get on. I'll have enough to keep me busy anyway! :) On Wed, Jan 23, 2013 at 3:51 AM, tjholowaychuk tjholoway...@gmail.comwrote: https://github.com/visionmedia/supertest is another alternated specific to testing http vs using

[nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread mscdex
On Jan 23, 4:05 am, Ket kettin...@gmail.com wrote: Hi, I'm just wondering why I cannot send a binary data larger than 64k bytes. And by 64k bytes I mean 64 x 1024 = 65,536 bytes. Thank you You can certainly send more than 64k bytes. We need more information. Do you have example code? What,

Re: [nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Arunoda Susiripala
Yes. Please give us more information How and where do you send them? What are the modules you use? On Wed, Jan 23, 2013 at 4:49 PM, mscdex msc...@gmail.com wrote: On Jan 23, 4:05 am, Ket kettin...@gmail.com wrote: Hi, I'm just wondering why I cannot send a binary data larger than 64k

Re: [nodejs] suggestions for API tests

2013-01-23 Thread Андрей Листочкин
Another suggestion: a ready-made binding between Mocha and Request: https://npmjs.org/package/omf Getting Mocha and Request work together is quite easy but OMF saves quite a bit of boilerplate for you. We use it for a current project and can't be happy! On Jan 23, 2013, at 11:24 , John Rellis

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Austin William Wright
On Wednesday, January 23, 2013 1:13:47 AM UTC-7, Isaac Schlueter wrote: On Tue, Jan 22, 2013 at 7:00 PM, Austin William Wright diamon...@users.sourceforge.net javascript: wrote: On the contrary, what sort of project could Node.js be if everyone actually cared about doing things the

Re: [nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Ket
Thank you, It's just the codes I've taken from here: http://www.adobe.com/devnet/html5/articles/real-time-data-exchange-in-html5-with-websockets.html I cannot send binary data of picture larger than 64k bytes. On Wednesday, January 23, 2013 6:33:03 PM UTC+7, Arunoda Susiripala wrote: Yes.

[nodejs] Question about logging in modules

2013-01-23 Thread Nikolas Everett
So I went and created a somewhat reusable component and published it in npm. It really isn't worth anyone's time at this point but it I've encountered an issue. My problem is that I want to log stuff in my module so I went and included winston and logged to my little heart's content and it

[nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread mscdex
On Jan 23, 10:14 am, Ket kettin...@gmail.com wrote: It's just the codes I've taken from here:http://www.adobe.com/devnet/html5/articles/real-time-data-exchange-in... That's all client-side stuff. What are you using on the server side? -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Jacob Groundwater
Other costs, like how require(foo/bar) can be either foo/bar, or foo/bar.js, or foo/bar/index.js, are simply historical mistakes that seemed like a good idea at the time, but provide no value, and are now too costly to remove. Is `index.js` considered a non-preferred method of doing package

[nodejs] Re: Question about logging in modules

2013-01-23 Thread Geerten van Meel
You could allow users to provide a user definable logger function in an options object. Just define in your docs how the logging callback should behave, i.e. it should be a callback function of the sorts function (level, message, metadata). However, think thoroughly whether you really need to

[nodejs] HTTP Response pause/resume

2013-01-23 Thread Katsumoto
Hi there, I'm trying to download a large video file with Http.request, simple example: script src=https://gist.github.com/4611134.js;/script So the problem here is that response.pause() looks to not work for all response types. The video has type of video/webm and pause doesn't work, it looks

[nodejs] Re: HTTP Response pause/resume

2013-01-23 Thread Katsumoto
среда, 23 января 2013 г., 20:20:28 UTC+2 пользователь Katsumoto написал: Hi there, I'm trying to download a large video file with Http.request, simple example: https://gist.github.com/4611134 So the problem here is that response.pause() looks to not work for all response types. The

[nodejs] Re: HTTP Response pause/resume

2013-01-23 Thread Katsumoto
The gist: https://gist.github.com/4611134 -- 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

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Isaac Schlueter
On Wed, Jan 23, 2013 at 9:13 AM, Jacob Groundwater ja...@nodefly.com wrote: Is `index.js` considered a non-preferred method of doing package imports? I really like it, but arguing a stable feature is pointless. I'm just curious what the reasons were for including it, and what has changed since?

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Jacob Groundwater
index.js predates packages by quite a long time. It was the first load a packagey folder thing as if it was a single module feature, dating back to the 0.1.x days. It's not terrible. But personally I prefer a main script in package.json, since you can name it something more appropriate

Re: [nodejs] Re: Question about logging in modules

2013-01-23 Thread Isaac Schlueter
The logging goes in the cli app, not in the reusable library. (If your module is both, you *might* be Doing It Wrong, at least a little bit. Don't feel bad, it's a common mistake that even the best of us make.) In reusable libs, there are two approaches that I've found useful. The first is to

Re: [nodejs] Re: Question about logging in modules

2013-01-23 Thread Nathan Rajlich
On the optional debug mode note, I'm a big fan of TJ's debug() module: https://github.com/visionmedia/debug On Wed, Jan 23, 2013 at 11:12 AM, Isaac Schlueter i...@izs.me wrote: The logging goes in the cli app, not in the reusable library. (If your module is both, you *might* be Doing It Wrong,

[nodejs] Re: HTTP Response pause/resume

2013-01-23 Thread greelgorke
http://nodejs.org/api/stream.html#stream_stream_pause second paragraph. did you tried to wait longer before resume? 5 seconds might be not really much Am Mittwoch, 23. Januar 2013 19:24:27 UTC+1 schrieb Katsumoto: The gist: https://gist.github.com/4611134 -- Job Board:

Re: [nodejs] suggestions for API tests

2013-01-23 Thread John Rellis
great! thanks! On Wed, Jan 23, 2013 at 1:43 PM, Андрей Листочкин andrey.listoch...@gmail.com wrote: Another suggestion: a ready-made binding between Mocha and Request: https://npmjs.org/package/omf Getting Mocha and Request work together is quite easy but OMF saves quite a bit of

[nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Ket
It's Worlize here: https://github.com/Worlize/WebSocket-Node I have no idea if different sever-side vendors make different performance. On Wednesday, January 23, 2013 11:38:58 PM UTC+7, mscdex wrote: On Jan 23, 10:14 am, Ket kettin...@gmail.com wrote: It's just the codes I've taken from

[nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Bradley Meck
Are we talking about the frame limitation here? Packets above a certain size will be split into frames as appropriate. -- 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

[nodejs] Re: Why I cannot send binary data file larger than 64k bytes

2013-01-23 Thread Ket
Do you mean the stream can be split into frames. How? I heard about buffer. Do you think I can send data in pieces of buffer? On Thursday, January 24, 2013 8:00:50 AM UTC+7, Bradley Meck wrote: Are we talking about the frame limitation here? Packets above a certain size will be split into

[nodejs] Re: how to end request and retry - after getting response close

2013-01-23 Thread am_p1
Thanks!! that was all it took... moving that 1 line to within the function... not sure why the data event was being handled just fine the other way though... but it's working so thanks again!! On Wednesday, January 23, 2013 3:45:51 AM UTC-5, greelgorke wrote: put your oa.get call in your

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Austin William Wright
On Wednesday, January 23, 2013 11:34:17 AM UTC-7, Isaac Schlueter wrote: On Wed, Jan 23, 2013 at 9:13 AM, Jacob Groundwater ja...@nodefly.comjavascript: wrote: Is `index.js` considered a non-preferred method of doing package imports? I really like it, but arguing a stable feature

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Isaac Schlueter
On Wed, Jan 23, 2013 at 7:30 PM, Austin William Wright diamondma...@users.sourceforge.net wrote: ... Look, here's the bottom: The module system is locked. We're not interested in changing it. The source is open, so you can go nuts on it if you'd like. Your feelings about node's module system

Re: [nodejs] a pakage that exports few modules

2013-01-23 Thread Miller Medeiros
Since it's still being discussed... ## To give some context I'm all favor of small modules that does one thing and does it well, single responsibility is usually my mantra except when it doesn't. Almost all my open source projects have a single responsibility: -

Re: [nodejs] Re: Is it possible to use classic ASP components with nodejs?

2013-01-23 Thread Umut Muhaddisoglu
This looks so good to be true. Seems hard to debug but will probably work. Thanks so much and will give it a try. On Wednesday, January 16, 2013 12:31:42 PM UTC+2, ajlopez wrote: Ummm... as pointed in this thread, there is a dll with ping functionality. One option it's using Node.js FFI