This is a newer version of my original canvasrenderer script (Python).
This one is written in JavaScript, for using with node.js.
In this newer version you can use CoffeeScript to write your scripts, as well as using other node.js' modules to do stuff.
Install CoffeeScript and node-canvas, then download this and make a symlink to this script.
canvasrenderer script.js
For CoffeeScript use:
canvasrenderer script.coffee
I know that this API is ugly and hackish, but is made in order to be compatible with the old version.
newFile(width, height): create a new canvas with width w and height h.
saveFile(name): save file to a file called name.png
canvas: the canvas
ctx: the 2d context
w: current canvas width
h: current canvas height