title: How to use commander.js command through npm command
body: <p>I'm using commander.js command like this <code>./index.js --project mono --type item --title newInvoice --comments 'Creates an invoice' --write</code>, Now I'm using the command through <code>npm run item newInvoice</code> by setting some options in <code>package.json</code> file like this</p>
  
  <pre class="lang-json prettyprint-override"><code>"scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
      "snapshot": "node --max-old-space-size=10240 ./scripts/snapshot.js",
      "item": "./index.js --project mono --type item --title",
      "config": "./index.js --project mono --type config --title"
  }
  </code></pre>
  
  <p>But whenever I'm trying to get the <code>--write</code> option with npm using <code>npm run item newInvoice --write</code> it's showing <code>undefined</code> for <code>--write</code></p>
  
  <p>Source Code:</p>
  
  <pre class="lang-js prettyprint-override"><code>#!/usr/bin/env node
  const fs = require('fs');
  const program = require('commander');
  require('colors');
  
  program
    .version('0.1.0')
    .option('--project [project]', 'Specifies the project name', 'mono')
    .option('--type [type]', 'Type of code to generate, either "item" or "config"', /^(config|item)$/, 'config')
    .option('--title [title]', 'Title of the item or config', 'untitled')
    .option('--comments [comments]', 'Configs: describe the config', '@todo description/comments')
    .option('--write', 'Write the source code to a new file in the expected path')
    .option('--read', 'To see what would be written the source code to a new file in the expected path')
    .parse(process.argv);
  
  console.log(program.write, program.read); //=&gt; undefined undefined
  </code></pre>
  
  <p>Can anyone help me how to use commander js command with npm?</p>