mixarg

0.2.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i mixarg

Weekly Downloads

100

Version

0.2.0

License

MIT

Last publish

Collaborators

  • popomore