0.2.0 • Published 11 years ago

mixarg v0.2.0

Weekly downloads
23
License
MIT
Repository
github
Last release
11 years ago

mixarg

NPM version Build Status Build Status NPM downloads

mixin argument with defaults using minimist


Install

$ npm install mixarg -g

Usage

var mixarg = require('mixarg');
var default = {
  cwd: process.cwd(),
  include: 'relative',
  verbose: false
};
mixarg(defaults, '--verbose --include=all', {cwd: '/home/admin'});
// return
// {
//   cwd: '/home/admin',
//   include: 'all',
//   verbose: true
// }

API

mixarg(arg1, ..., argN);

  • arg should be object or string(parsed by minimist)
  • the latter argument has high priority than the former one

LISENCE

Copyright (c) 2014 popomore. Licensed under the MIT license.