title: Passing key value arguments from npm
body: <p>So I'm struggling with passing command line option arguments from npm to a node script.  I can pass options themselves, but not as key value pairs.</p>
  
  <p>For my package.json I have:</p>
  
  <pre><code>"scripts": {
     "test": ". ./.env; node app.js --"
   },
  </code></pre>
  
  <p>(my understanding is that for npm you need to include and extra "--" to pass arguments)
  and in my app.js I have:</p>
  
  <pre><code>const { argv, options } = require('yargs');
  console.log(argv._);
  </code></pre>
  
  <p>When I run </p>
  
  <pre><code>$ npm run test FOO BAR
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p>[ 'FOO', 'BAR' ]</p>
  </blockquote>
  
  <p>great, that worked, but if I try</p>
  
  <pre><code>$ npm run test FOO --BAR 99RedBalloons
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p>[ 'FOO', '99RedBallons' ]</p>
  </blockquote>
  
  <p>and </p>
  
  <p>$ npm run test FOO --BAR=99RedBallons
  gives me:</p>
  
  <blockquote>
    <p>[ 'FOO' ]</p>
  </blockquote>
  
  <p>Wha?  So, my question really is, using "run npm &lt;>" and I assume yargs (since I believe that is the most popular package), how can I arrive with a arg._ of ["FOO", "Bar" : "99RedBalloons"].</p>
  
  <p>Thanks!</p>