Node 0.11.12 is out. It updates uv, some of Node's C++ code in
src/, and several core modules including cluster and net.
One commit that caught my attention was buffer: allow toString to accept Infinity for end by Brian White. He said he sometimes sets
Infinity, allowing the buffer's contents to be printed for debugging purposes. I think it's interesting that this works, even though it's not something I'd usually want to do.
Ian Storm Taylor sent in Metalsmith, a really cool static site generator by Segment.io. Why is it cool? Well, they had me at the entirely plugin-based API that uses chainable calls:
Metalsmith(__dirname) .use(drafts()) .use(markdown()) .use(permalinks('posts/:title')) .use(templates('handlebars')) .build();
Promises and Error Handling
Promises and Error Handling by Jon Merrifield is all about error handling with promises in Node. It has guidelines for using promises safely, including the idea that you should reject rather than
throw and how to terminate chains early and safely.
thenin the above code to
donemeans that there will be no outer promise returned from this, and the error will result in an asynchronous uncaught exception, which will bring down the Node process. In theory this makes it unlikely that any such problem would make it into production, given how loudly and clearly it would fail during development and testing.