mixarg
mixin argument with defaults using minimist
Last updated 10 years ago by popomore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install mixarg 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.2.0                                ...           latest (10 years ago)

3 Versions

  • 0.2.0                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |