title: NPM conditional script (Windows / Mac) shall execute different commands)
body: <p><strong>Use case:</strong></p>
  
  <p>I am setting up a <code>prepublishOnly</code> hook in NPM which deletes the "lib" folder, then transpiles the typescript source files into a new lib folder and then it does run the test.</p>
  
  <p><strong>The problem:</strong></p>
  
  <p>Two persons are supposed to publish the NPM packages, both working on different OS (Windows / Mac). Therefore the commands for deleting the folders are different.</p>
  
  <pre><code>  "scripts": {
      "build": "tsc",
      "clean": "rm -rf lib",
      "clean:windows": "if exist lib rmdir /s /q lib",
      "lint": "tslint --project tsconfig.json --format stylish src/**/*.ts",
      "format": "prettier --write \"**/*.ts\""
    },
    "husky": {
      "hooks": {
        "pre-push": "npm run clean:windows &amp;&amp; npm run build &amp;&amp; npm run test"
      }
    },
  </code></pre>
  
  <p><strong>The question:</strong></p>
  
  <p>Is there a way to run NPM scripts conditionally (based on the used OS) or is there a remove folder command which works across these OS?</p>