Registry / serialization / lodash.findwhere

lodash.findwhere

JSON →
library3.1.0jsnpmunverified

The `lodash.findwhere` package provides the `_.findWhere` utility function, originally part of Lodash v3. This standalone module is frozen at version 3.1.0, reflecting the state of the function in the broader Lodash library prior to its major v4 release. `_.findWhere` was deprecated and subsequently removed in Lodash v4 in favor of `_.find` combined with an object shorthand predicate. Consequently, this module is no longer actively maintained or receiving updates, including security patches, that are applied to the modern `lodash` package. Its primary use case now is for maintaining compatibility with legacy codebases tied to Lodash v3, or for selectively importing this specific deprecated functionality into projects that are otherwise on newer Lodash versions but require this exact behavior. Its release cadence is effectively ceased.

npm install lodash.findwhere
INSTALL
IMPORT
SIG · LODASH.FINDWHERE
L
lodash.findwhere
serializationjavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

findWhere
const findWhere = require('lodash.findwhere');
This package is a CommonJS module from Lodash v3; no ESM import is available or recommended for this specific legacy module.

Demonstrates how to import and use the `findWhere` function to find an object in a collection based on a properties object, typical for legacy Lodash v3 usage.

const findWhere = require('lodash.findwhere'); const users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user': 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1, 'active': true } ]; // Find an object where 'age' is 1 and 'active' is true const result = findWhere(users, { 'age': 1, 'active': true }); console.log(result); // => { 'user': 'pebbles', 'age': 1, 'active': true } // This demonstrates the original behavior of _.findWhere, which has been superseded.
Debug
Known issues
breakingThe `_.findWhere` function was completely removed from the main Lodash library in version 4. This `lodash.findwhere` package provides the v3 implementation and is incompatible with modern Lodash's API for this functionality. Direct use of `_.findWhere` will result in a `TypeError: _.findWhere is not a function` if relying on a v4+ `lodash` bundle.
fix
Migrate to `_.find(collection, { property: value })` in Lodash v4+ or newer versions. For example, use `_.find(users, { age: 1, active: true })` instead of `_.findWhere(users, { age: 1, active: true })`.
affects: >=4.0.0 (for main lodash)
deprecatedThis `lodash.findwhere` package is effectively abandoned. It is frozen at v3.1.0 and will not receive security updates, bug fixes, or enhancements applicable to modern `lodash` versions (v4 and beyond). Continuing to use it may expose projects to unpatched vulnerabilities.
fix
Avoid using this standalone module in new projects. For existing projects, prioritize refactoring to use `_.find` with an object predicate from the main `lodash` package to ensure ongoing maintenance and security.
affects: >=3.1.0
gotchaMixing `lodash.findwhere` (from Lodash v3) with a modern `lodash` (v4+) bundle can lead to unexpected behavior, increased bundle sizes due to duplicate functionality, and potential conflicts. The functionality provided by this module is superseded by a different API.
fix
Consolidate to a single `lodash` version (ideally v4+), and use `_.find` with an object predicate for the equivalent functionality. Audit your dependency tree to remove redundant or legacy Lodash modules.
affects: >=3.1.0
Errors
Common errors & fixes
TypeError: _.findWhere is not a function
Attempting to use `_.findWhere` after upgrading the main `lodash` package to version 4 or higher, which removed the function.
fix
Replace `_.findWhere(collection, predicate)` with `_.find(collection, predicate)` from Lodash v4+ or install `lodash.findwhere` explicitly if you must use the legacy function.
Cannot find module 'lodash.findwhere'
The `lodash.findwhere` dependency is not installed or the import path is incorrect, especially in projects not configured for legacy modules.
fix
Install `lodash.findwhere` via `npm install lodash.findwhere` if you explicitly intend to use this deprecated module. Otherwise, consider refactoring to use `_.find` from the main `lodash` package.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources