title: NPM: make package.json work under both Unix (Mac OSX) and Windows
body: <p>I've gotten some NPM package from a third party who is developing under Mac OSX. Their build can split into either development or production using "scripts" object in package.json. For example:</p>
  
  <pre><code> "scripts": {
      "build": "NODE_ENV=dev node make.js --build",
      "build-prod": "NODE_ENV=prod node make.js --build",
    }
  </code></pre>
  
  <p>Under Unix, one can run either "npm run build" or "npm run build-prod" to build either directory (naturally, there are some conditional statements in make.js).
  Of course, it does not work under Windows - I had to change the commands similar to this:</p>
  
  <pre><code> "scripts": {
      "build": "set NODE_ENV=dev&amp;&amp; node make.js --build",
      "build-prod": "set NODE_ENV=prod&amp;&amp; node make.js --build",
    }
  </code></pre>
  
  <p>(Please note that it was important <strong>not</strong> to put a space before the '&amp;&amp;' - otherwise the environment variable was created with an extra white space in it which ruined all those comparisons in make.js).</p>
  
  <p>However, I would like to have some universal source tree which would work under either Unix or Windows without editing. Could you please give some ideas on how to conditionally split the build depending on the OS?</p>