Socket
Socket
Sign inDemoInstall

object-merger

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    object-merger

Deep merge objects, better version of native Object.assign.


Version published
Weekly downloads
12
increased by300%
Maintainers
1
Install size
13.8 kB
Created
Weekly downloads
 

Readme

Source

Object Merger

Merge Javascript Objects properly instead of overwriting them. Essentially a deep Object.assign. It's very simple, written in ES6+ and handles a basic deep copy of objects.

This was written due to lack of power with Object.assign and the heavier weight of some alternative packages trying to support everything.

Usage

const merge = require('object-merger');
const obj4 = merge(obj1, obj2, obj3); // returns a new object, doesn't modify existing.

Optionally you could add a static to the Object

Object.merge = require('object-merger');
const obj4 = Object.merge(obj1, obj2, obj3); // returns a new object, doesn't modify existing.

Check out the test folder for more!

Installation

$ npm install object-merger

Features

  • Merge multiple objects instead of overwrite them.
  • Simple, fast, light-weight with no external dependencies
  • Written in ES6+ for node.js 6+
  • Test driven

Options

As many objects as you'd like to merge from left to right.

Tests

From the package

$ npm test

License

MIT

Keywords

FAQs

Last updated on 31 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc