Skip to content

popomore/mixarg

Repository files navigation

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.

About

mixin argument with defaults using minimist

Resources

Stars

Watchers

Forks

Packages