Mixme is a JavaScript/TypeScript library (currently at v2.0.2) designed for recursively merging and manipulating JavaScript objects. It provides immutable merging via `merge` and mutable in-place modification via `mutate`. Key differentiators include its zero-dependency footprint, minimal size, and pure function approach for `merge`. It offers comprehensive TypeScript type definitions and supports both ES Modules (ESM) and CommonJS environments. While a specific release cadence isn't explicitly published, the project appears actively maintained with a streamlined release process via GitHub Actions. A notable behavior is that arrays are always overwritten during merges, not recursively combined, which is a common point of confusion for users expecting deep array merging.
npm install mixmeVerified import paths — ran on the pinned version, not inferred.
Demonstrates `merge` for immutable object combination, `mutate` for in-place modification, and `snake_case` utility, highlighting how arrays are overwritten.
If deep array merging is required, you must preprocess arrays manually before passing them to `mixme` or use a different library designed for deep array merging.
Use `const myObjectCopy = clone(myObject); mutate(myObjectCopy, changes);` if you intend to keep the original object intact. Use `merge` for an immutable approach that always returns a new object.
Ensure your project's module system is correctly configured. For ESM, use `import { func } from 'mixme';`. For CJS, use `const { func } = require('mixme');`. Refer to Node.js documentation on ESM/CJS interoperability.Ensure your `package.json` contains `"type": "module"` for ESM, or rename `.js` files using `import` to `.mjs`. Alternatively, if staying with CommonJS, use `const { merge } = require('mixme');`.In CommonJS, you must destructure the named export: `const { merge } = require('mixme');` or access it as a property: `const mixme = require('mixme'); const result = mixme.merge(...);`.Switch to `import` syntax: `import { merge } from 'mixme';` instead of `const { merge } = require('mixme');`. If legacy CommonJS modules are needed in an ESM project, consider dynamic `import()` or specific tools like `createRequire`.No dependency data recorded yet.