Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including nested-object-assign with all npm packages installed. Try it out:

var nestedObjectAssign = require("nested-object-assign")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nested-object-assign v1.0.3

Package to support nested merging of objects & properties, using Object.Assign


Build Status dependencies Status

This package extends the functionality given by Object.assign() to also include the values of nested objects.


npm install --save nested-object-assign


Works just like Object.Assign, add an empty object first (the object you want the other objects merged into), then as many objects as you wish afterwards, comma separated.

import nestedObjectAssign from 'nested-object-assign';
const defaults = {}

function test() {
    let data = nestedObjectAssign({}, defaults, object1, object2, object3);


Tests were done for these node.js versions:

  • 8
  • 7
  • 6
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free