I'm writing a canvas-powered multiuser drawing application in Node.js, and want to maintain an internal canvas element with the current drawing. Is it possible to create and interact with a canvas element in Node.js?
My latest try was the jsdom module available here: http://github.com/tmpvar/jsdom
var jsdom = require('jsdom');
var window = jsdom.jsdom().createWindow();
var canvas = window.document.createElement('canvas');
// The following line works
canvas.setAttribute('width', 1000);
// The following line errors out on execution:
var context = canvas.getContext('2d');
Is there any other way to go about this?