obj-merge

0.0.4 • Public • Published

obj-merge

Build Status npm install

accumulate some object properties

usage

var objm = require('obj-merge')
 
var cliOptions = {
    flags: ['norecurse', 'skipdotfiles']
  , files: 'good.md'
  , cat: 'Black Cat'
}
 
var configOptions = {
    flags: ['verbose', 'debug']
  , book: {name: 'Pet Sematary'}
}
 
var misc = {
    flags: 'makeabeep'
  , files: 'test.txt'
  , book: true
}
 
console.log(objm(cliOptions, configOptions, misc)) // =>
 
/*
{
    flags: ['norecurse', 'skipdotfiles', 'verbose', 'debug', 'makeabeep']
  , files: ['good.md', 'test.txt']
  , book: [{name: 'Pet Sematary'}, true]
  , cat: 'Black Cat'
}
*/

throw any number of objects at it (even 0) and it will return an object with all of their top-level keys combined.

license

MIT

Package Sidebar

Install

npm i obj-merge

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • jarofghosts