[nodejs] Re: Merging a layout document with a database record

2012-03-04 Thread fent
Use an unobtrusive templating engine https://github.com/flatiron/plates On Sunday, March 4, 2012 2:29:59 AM UTC-7, Tito wrote: Hello, I was wondering what is the best way to serve pages created by merging an HTML layout with contents from a database record. In my case, I'm using the

[nodejs] Re: Exposing more than one function via module: function default() vs module.exports.notdefault()

2012-03-04 Thread fent
I think what mikeal's point was that your module should focus on one main purpose. Any extra features should be attached to the main _default_ funtion. There are however modules with many main features like utility belts underscore and utile. On Sunday, March 4, 2012 2:13:43 AM UTC-7, Tito

[nodejs] Re: Streaming parser for XML and JSON

2012-03-02 Thread fent
Have a look at https://github.com/isaacs/sax-js On Friday, March 2, 2012 3:46:35 AM UTC-7, Felix Wan wrote: Hi Gurus, I'm trying to convert some related large XML files (~30MB) to JSON format. I've tried some out of box solutions such as xml2js, xml2json. All of them consumes a lot of

[nodejs] Re: Buffer concatenation - why does it work?

2012-02-28 Thread fent
I don't know the details of your file upload, but usually, uploading by chunks is faster and uses less memory. On Tuesday, February 28, 2012 4:41:54 PM UTC-7, billywhizz wrote: I'm struggling to understand why the following works when concatenating two buffers into strings: var a = new

[nodejs] Re: JSLint or not?

2012-02-20 Thread fent
Feels free to use jslint/hint in your code if that adheres to your style. But don't go trying to correct others' style with it. Different coding styles are accepted by others as long as they have good reasoning behind them. Omitting semicolons can make code look cleaner, there's less to type,

[nodejs] Re: testing a simple app.get call

2012-02-16 Thread fent
Take a look at zombie.js http://zombie.labnotes.org/ -- 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

[nodejs] Re: Control over 'require' logic

2012-02-14 Thread fent
Take a look at http://howtonode.org/testing-private-state-and-mocking-deps -- 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

[nodejs] Re: How to continuously read a file while the file is been writing

2012-02-02 Thread fent
Take a look at https://github.com/felixge/node-growing-file On Feb 2, 3:30 am, 宓俊 miju...@gmail.com wrote: I want the user to be able to download a file while it is uploading. So I write this code to test. var fs = require('fs'); var writeStream = fs.createWriteStream(__dirname +