title: Is this a feasible idea for auto-updates of a CLI through npm?
body: <p>I'm writing a cli to run on node. I'm going to distribute it using npm. I really like Chrome/Firefox's model of automatic updates.</p>
  
  <p>Would it be a bad idea to simply call the following on startup, or right before the process ends?</p>
  
  <pre><code>require('child_process').exec('npm update -g package-name');
  </code></pre>
  
  <p>I honestly don't see why it wouldn't, assuming all users install through <code>npm i -g package-name</code>.</p>
  
  <p>PS: thought of asking this in <a href="http://programmers.stackexchange.com">programmers.stackexchange.com</a> instead, but chose stack overflow. Do let me know if this question is out of place though.</p>