Node Roundup: 0.11.12, Metalsmith, Promises and Error Handling

2014-03-12 00:00:00 +0000 by Alex R. Young
Job ad: Iridize is looking for a lead frontend developer.

Node 0.11.12

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 INSPECT_MAX_BYTES to 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:


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.

Changing the then in the above code to done means 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.