Chromium ships with a --headless starting in version 59. Electron 1.8.1 (in pre-release as of 2017/10/11) ships with Chromium 59. So our days of having to use xvfb might be numbered 🎉
But, this won't happen now. I tried [email protected] in this gist, but looks like the --headless option (and additional required flags) aren't compatible with WebGL. If your interested, pull down that gist and run npm start -- gl3d_bunny - you should see electron hanging and failing to generate an image. In contrast, for regular SVG graphs e.g. npm start -- 10, headless seems to work ok.
See electron/electron#228 for more info.