Filter object keys and values into a new object using predicate functions or key arrays.
filter-obj is a JavaScript utility library that filters object keys and values into a new object. It solves the problem of selectively extracting or removing properties from objects without mutating the original data, using either predicate functions or explicit key lists.
JavaScript developers who need to manipulate objects in a functional, immutable way, particularly those working with data transformation, configuration objects, or API response filtering.
Developers choose filter-obj for its minimal, focused API that handles object filtering with zero dependencies, clear semantics (include/exclude), and support for both functional predicates and simple key lists.
Filter object keys and values into a new object
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides both includeKeys and excludeKeys functions, making filtering logic intuitive and reducing boilerplate code for common use cases.
Always returns a new object without mutating the original, ensuring predictable behavior and compatibility with functional programming patterns.
Supports predicate functions for dynamic filtering and key arrays/Sets for static selection, as shown in the README examples.
Handles both string and Symbol keys, which native methods like Object.keys often ignore, offering broader compatibility.
Limited to top-level keys; filtering nested properties requires manual recursion or additional utilities, increasing complexity.
Creates new objects for every operation, which can lead to performance issues in memory-sensitive or high-frequency scenarios.
As a single-purpose library, it lacks integrations with common frameworks or tooling, unlike comprehensive utility libraries like Lodash.