title: Is there a way to automatically install node.js dependencies from a .js file?
body: <p>If I have a foo.js node script, is there a way for me to automatically install all the npm dependencies?</p>
  
  <p>e.g. If foo.js had this:</p>
  
  <pre><code>var program = require('commander');
  var cheerio = require('cheerio');
  </code></pre>
  
  <p>Is there any npm command or something that I could do that would read foo.js and do 'npm install commander;npm install cheerio'?</p>