minimist的用法

npm install minimist --save 后,


#!/usr/bin/env node

var parseArgs = require('minimist')(process.argv.slice(2));

console.log(parseArgs);    //=>    { _: [ 'gsky' ], drunk: true }


var index = require('/home/vagrant/greet');


console.log(index(parseArgs._,parseArgs.drunk));

posted on 2014-03-25 01:15  秋叶leaf  阅读(1407)  评论(0编辑  收藏  举报