Socket
Socket
Sign inDemoInstall

mixme

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixme

A library for recursive merging of Javascript objects


Version published
Weekly downloads
979K
increased by8.22%
Maintainers
1
Weekly downloads
 
Created

What is mixme?

Mixme is a utility library for deep merging of objects. It allows you to combine multiple objects into one, handling nested properties and arrays gracefully.

What are mixme's main functionalities?

Deep Merge

This feature allows you to deeply merge two or more objects. Nested properties are merged recursively.

const mixme = require('mixme');
const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { b: { d: 3 } };
const result = mixme.merge(obj1, obj2);
console.log(result); // { a: 1, b: { c: 2, d: 3 } }

Array Merge

This feature allows you to merge arrays within objects. The arrays are concatenated.

const mixme = require('mixme');
const obj1 = { a: [1, 2] };
const obj2 = { a: [3, 4] };
const result = mixme.merge(obj1, obj2);
console.log(result); // { a: [1, 2, 3, 4] }

Custom Merge Function

This feature allows you to provide a custom merge function to define how values should be combined.

const mixme = require('mixme');
const obj1 = { a: 1, b: 2 };
const obj2 = { a: 3, b: 4 };
const customMerge = (a, b) => a + b;
const result = mixme.merge(obj1, obj2, customMerge);
console.log(result); // { a: 4, b: 6 }

Other packages similar to mixme

Keywords

FAQs

Package last updated on 16 Sep 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc