smart-merge

0.1.7 • Public • Published

Merge multiple Javascript objects

Deep merge any number of javascript objects.

NPM

install

npm install smart-merge

Usage

    var baseStyles = {
        header: {
            left: 10,
            position: 'absolute',
        },
        footer: {
            right: 10
        }
    };
    var rtlStyles = {
        header: {
            left: 40,
        }
    };
    var merge = require('smart-merge');
    merge(baseStyles, rtlStyles);

Result

{ 
    header:{ 
        left: 40, 
        position: 'absolute' 
    }, 
    footer:{ 
        right: 10 
    } 
}

Tests

Check the tests for more examples...

Package Sidebar

Install

npm i smart-merge

Weekly Downloads

95

Version

0.1.7

License

none

Last publish

Collaborators

  • mohamedamin