Narnia's Psychedelic Mushrooms
    Wondering what’s next for npm?Check out our public roadmap! »

    object-join

    1.0.2 • Public • Published

    object-join

    NPM version build status Test coverage

    Merge two objects recursively into a new object.

    Installation

    $ npm i --save object-join

    Overview

    /**
     * Initialize
     */
     
    var objectJoin = require('object-join');
     
    /**
     * Declare objects
     */
     
    var obj1 = {foo: 'bar'};
    var obj2 = {bin: 'baz'};
     
    /**
     * Merge objects
     */
     
    var newObject = objectJoin(obj1, obj2);
    // => {foo: 'bar', bin: 'baz'};

    API

    objectJoin()

    Merges two objects into a new object. Takes {Object} obj1 and {Object} obj2 as arguments. If duplicate keys exist, {Object} obj2's keys take presedence.

    var newObject = objectJoin(obj1, obj2);
    // => {foo: 'bar', bin: 'baz'};

    License

    MIT © Yoshua Wuyts

    Keywords

    none

    Install

    npm i object-join

    DownloadsWeekly Downloads

    3

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • avatar