Update (1/7/12): According to Ben Noordhuis, one of the core Node.js contributors and author of the buffertools module, you don’t really need to worry about using buffers when it comes to concatenating strings. Apparently V8 is extremely clever, so for example, a statement like a += b + c actually results in no copying whatsoever.
To make things easier, I recommend using a module called buffertools (github / npm) which augments the out-of-box Buffers object and makes it super-easy to efficiently append strings (note that it was written by one of the core NodeJS deveopers). To borrow from the project’s own documentation, here’s an example:
require('buffertools'); // The next three lines are identical to doing "new Buffer('foobarbaz')" a = new Buffer('foo'); b = new Buffer('bar'); c = a.concat(b, 'baz'); // non-standard function added by buffertools console.log(a, b, c); // "foo bar foobarbaz" // static variant buffertools.concat('foo', new Buffer('bar'), 'baz');
Note that buffertools won’t work out-of-box on Windows since it uses UNIX-only native code.