mixarg
v0.2.0
Published
mixin argument with defaults using minimist
Downloads
360
Readme
mixarg
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.