Home

Awesome

parse-arguments npmjs.com The MIT License

Parse function to object with same key names as arguments names and values that you pass in same order.

code climate standard code style travis build status coverage status dependency status

Install

npm i parse-arguments --save

Usage

For more use-cases see the tests

const parseArguments = require('parse-arguments')

parseArguments

Parse function to object with same key names as its arguments names.

Params

Example

function fixture (xxx, yyy, zzz) {
  return parseArguments(arguments, fixture)
}
var parsed = fixture(444, {a: 'b'}, 'foo')

console.log(parsed.xxx) // => 444
console.log(parsed.yyy) // => { a: 'b' }
console.log(parsed.zzz) // => 'foo'
console.log(parsed) // => { xxx: 444, yyy: { a: 'b' }, zzz: 'foo' }

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github