title: How use backticks in npm scripts on windows
body: <p>My workflow is npm scripts, running commands in my node_modules along with simple shell commands.</p>
  
  <p>Unfortunately this makes it difficult for windows users due to my using backticks in some commands (see Example below).  I have a pull request volunteering to convert to <a href="https://github.com/shelljs/shx" rel="nofollow noreferrer">shellJS/shx</a> for my build so my repo will build cross-platform but we can't figure out a solution for backticks in npm scripts.</p>
  
  <p>Question:</p>
  
  <ul>
  <li>What shell does npm use? On windows it appears to not support backticks.</li>
  <li>Is there a workaround? Piping doesn't help, alas, rm, mkdir etc don't use stdin.</li>
  </ul>
  
  <p>Example backtick use in package.json:</p>
  
  <pre><code>  "mkdirs": [
      "dist/AS",
      "libs",
      "models/scripts"
    ],
    "scripts": {
      "mkdirs": "mkdir -p `bin/pkgkey.js mkdirs`",
      ....
  </code></pre>
  
  <p>.. where the <code>bin/pkgkey.js mkdirs</code> script simply returns the mkdirs array. This may seem odd but it's great for organizing npm-style workflow.</p>
  
  <p>The pkgkey script (simplified):</p>
  
  <pre><code>#!/usr/bin/env node
  
  const fs = require('fs')
  const json = JSON.parse(fs.readFileSync('package.json'))
  const key = process.argv[2]
  let val = json[key]
  if (Array.isArray(val)) val = val.join(' ')
  
  process.stdout.write(val)
  </code></pre>