title: Run node commands as root in electron app
body: <p>I am trying to write electron program for creating and configuring multiple Apache websites sites. But my problem is that i need to read from and write to files that are owned by root user. such as /etc/hosts, etc/apache/sites-avaliable/mysite.conf. my program works only when I run it as  root from terminal. but when i package it. I cannot launch it as root user. there as some pakages as sudo-prompt - npm. but they accept only terminal commands. But I want to use native node functions for accessing file system such as         </p>
  
  <pre><code>fs.writeFileSync(`/etc/apache2/sites-available/${serverName}.conf`, template);
  </code></pre>