LearnBoost/node-canvas — pull request #305 by rvagg (2013-07-21 07:25:45+00:00)
Title: 0.11.4+ compatibility using NAN

This is an alternative to #304 that adds [NAN](https://github.com/rvagg/nan) (Native Abstractions for Node) as a compatibility abstractions library and removes the need for version sniffing for 0.8 up to 0.11.4.

I won't be upset if you don't want to merge this, tbh I wanted another target to test NAN against to see what it's missing and thanks to node-canvas I've picked up a few new things. I already have a 0.11.4+ version of [LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48) using it and [ssh](https://github.com/rvagg/node-libssh/). Because the V8 changes are so dramatic, adding conditional macros just gets out of hand.

Tested in 0.8, 0.10 and 0.11.4 (earlier versions of 0.11 are a write-off, you can't version sniff them anyway).

(related, but not directly relevant to this: http://atxconsulting.com/2013/07/06/rewrite-it-anyway/)