title: Running electron (atom-shell) headlessly on linux server through Nightmare.js
body: <p>I am building a scraper to make JS single page applications easily crawlable.</p>
  
  <p>After some incredible <strong>frustration with PhantomJS</strong> (memory leaks, outdated webkit, undead processes, among many other problems) I decided to switch to <a href="http://www.nightmarejs.org/">NightmareJS</a> which can do the same things but uses <a href="http://electron.atom.io/">Electron</a> under the hood. Electron has a lot of advantages (uses <strong>latest chromium</strong>, is a lot faster) but it needs an X server to run.</p>
  
  <p>As I need to make it work under ubuntu server, I followed <a href="https://gist.github.com/AspireToCodeBetter/130877925f52c8fb2557">this gist</a> . Now I have a great EC2 instance with everything ready to run an <strong>headless electron</strong></p>
  
  <pre><code>xvfb-run electron
  </code></pre>
  
  <p>The point is that I need to run this through nightmareJS (which I will use in a node.js server script). I was wondering how I could <strong>pass parameters to nightmare in order to start electron through svfb</strong></p>