ngraph.merge is a minimalist JavaScript utility designed to extend target objects with properties from source objects without introducing external dependencies. It primarily operates as a shallow merge. Its key differentiator is a specific, somewhat unconventional, conflict resolution strategy: properties from the source will overwrite existing target properties only if their types differ. If the target already contains a property with the same name and type, it is *not* overwritten by the source property. The package is currently at version 1.0.0, with its last commit in 2017, indicating it is no longer actively maintained and has an abandoned release cadence. Its zero-dependency footprint makes it suitable for environments where bundle size and dependency chain control are critical, though its unique merge logic requires careful consideration.
npm install ngraph.mergeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic usage and highlights the specific shallow merge logic and overwrite behavior based on type matching.
Be aware of this specific merge logic. If you need a standard deep merge or consistent overwrite behavior, consider an alternative utility like `lodash.merge` or `deepmerge`.
For deep merging of nested objects, you will need to use a different utility specifically designed for deep merges.
For new projects or if active maintenance is required, consider modern, actively maintained alternatives that support ES Modules and have more conventional merge behaviors.
This package is CommonJS-only. If you are in an ES module environment (e.g., `"type": "module"` in package.json), you may need to use `import merge from 'ngraph.merge';` (which will likely fail if a CJS wrapper is not provided) or revert to a CJS environment. Alternatively, use a bundler that handles CJS modules in an ESM project.
This package is CommonJS-only. Use `const merge = require('ngraph.merge');` instead of `import` statements.Review the documentation and examples. If this behavior is not desired, consider using a different merge utility with standard overwrite behavior.
No dependency data recorded yet.