obj-merge

non-destructive extend

npm install obj-merge
6 downloads in the last week
11 downloads in the last month

obj-merge

Build Status

accumulate some object properties

usage

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

npm loves you