In order to generate some svg with d3 in node.js, you need a dom. This is a bare bones example of using jsdom for said dom.