Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Micro npm Packages
  3. set-value

set-value

MITJavaScript

Set nested properties on JavaScript objects using dot notation with high performance and extensive options.

Visit WebsiteGitHubGitHub
277 stars42 forks0 contributors

What is set-value?

Set-value is a JavaScript utility library that enables setting deeply nested properties on objects using dot-notation paths. It solves the problem of safely and efficiently creating or modifying complex object structures without manual property checking and object creation. The library handles edge cases like escaping and custom separators while maintaining high performance.

Target Audience

JavaScript and Node.js developers working with configuration objects, state management, data transformation pipelines, or any code requiring deep object manipulation.

Value Proposition

Developers choose set-value for its reliability, extensive options for path handling, and proven performance advantages over alternatives like lodash.set or dot-prop. It provides a focused API for a common task with robust escape mechanisms and merge capabilities.

Overview

Set nested properties on an object using dot-notation.

Use Cases

Best For

  • Setting deeply nested configuration values in application settings
  • Dynamically building complex object structures from flat data
  • Updating specific properties in large state objects (like Redux or Vuex)
  • Transforming API response data into nested object formats
  • Creating object paths from user-provided strings or templates
  • Merging new data into existing nested objects without overwriting

Not Ideal For

  • Projects requiring immutable data updates, such as functional programming or Redux reducers that avoid side effects
  • Environments where bracket notation for property access is essential without additional configuration
  • Simple applications needing only shallow object manipulation where native methods like Object.assign suffice
  • Teams prioritizing minimal dependencies and preferring to avoid external libraries for core utilities

Pros & Cons

Pros

Benchmark-Proven Performance

Extensive benchmarks show set-value outperforms competitors like lodash.set and dot-prop in deep, medium, and shallow property sets, making it the fastest choice for nested object manipulation.

Flexible Path Handling

Supports custom separators, path escaping with backslashes, and preserves paths with '/' by default, enabling versatile use cases such as handling URL properties without unwanted splitting.

Merge Functionality

Offers a merge option to shallowly merge values with Object.assign or allow custom deep merge functions, preventing overwrites and facilitating incremental object updates.

Robust Edge Case Coverage

Handles complex scenarios like dots in property names through escaping and provides options for custom split functions, ensuring correctness where other libraries fail.

Cons

Mutates Original Object

Directly modifies the input object, which can introduce side effects and is incompatible with immutable data patterns or functional programming practices that require purity.

No Built-in Bracket Support

Bracket notation support was removed in v3.0.0 and now requires a custom split function, adding complexity for users who rely on that syntax without extra configuration.

Critical Bug History

The README warns of a critical bug fixed only in v3.0.1, indicating past stability issues that necessitate careful version management and may affect trust in older releases.

Frequently Asked Questions

Quick Stats

Stars277
Forks42
Contributors0
Open Issues8
Last commit3 years ago
CreatedSince 2015

Tags

#object-manipulation#dot-notation#object#configuration#nodejs#utility-library#javascript#set#value#data-transformation#path

Built With

J
JavaScript
N
Node.js

Links & Resources

Website

Included in

Micro npm Packages4.6k
Auto-fetched 22 hours ago

Related Projects

deep-object-diffdeep-object-diff

Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️

Stars1,140
Forks97
Last commit2 years ago
stringify-objectstringify-object

Stringify an object/array like JSON.stringify just without all the double-quotes

Stars324
Forks43
Last commit8 months ago
get-valueget-value

Use property paths (`a.b.c`) get a nested value from an object.

Stars295
Forks22
Last commit1 year ago
deep-assigndeep-assign

[DEPRECATED] Recursive Object.assign()

Stars246
Forks34
Last commit5 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub