title: npm check and update package if needed
body: <p>We need to integrate Karma test runner into TeamCity and for that I'd like to give sys-engineers small script (powershell or whatever) that would:</p>
  
  <ol>
  <li><p>pick up desired version number from some config file (I guess I can put it as a comment right in the <code>karma.conf.js</code>)</p></li>
  <li><p>check if the defined version of karma runner installed in npm's global repo</p></li>
  <li><p>if it's not, or the installed version is older than desired: pick up and install right version</p></li>
  <li><p>run it: <code>karma start .\Scripts-Tests\karma.conf.js --reporters teamcity --single-run</code></p></li>
  </ol>
  
  <p>So my real question is: "how can one check in a script, if desired version of package installed?". Should you do the check, or it's safe to just call <code>npm -g install</code> everytime?</p>
  
  <p><em>I don't want to always check and install the latest available version, because other config values may become incompatible</em></p>