Registry / data / lodash._arrayfilter

lodash._arrayfilter

JSON →
library3.0.0jsnpmunverified

This package, `lodash._arrayfilter`, provides a modularized, internal implementation of `arrayFilter` originally part of the Lodash v3 ecosystem. Released around 2014-2015, this version (`3.0.0`) predates the significant breaking changes and API refinements introduced with Lodash v4 (currently at `4.18.1`). While the main `lodash` library continues active development with a steady release cadence, `lodash._arrayfilter` as a standalone module is no longer actively maintained. Its original purpose was to allow granular imports of internal Lodash utilities for specific environments, a need largely superseded by modern JavaScript bundlers offering robust tree-shaking capabilities for the complete `lodash` package. It is a CommonJS-only module and is primarily compatible with other Lodash v3 components, making it largely unsuitable for contemporary projects using `lodash` v4+ or ES modules. Key differentiators at its time included extreme modularity for internal functions, but this approach is now considered legacy.

npm install lodash._arrayfilter
INSTALL
IMPORT
SIG · LODASH._ARRAYFILTE
L
lodash._arrayfilter
datajavascriptv3.0.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.

arrayFilter
const arrayFilter = require('lodash._arrayfilter');
import arrayFilter from 'lodash._arrayfilter';
This package is a CommonJS module from Lodash v3 and does not support ES module import syntax.
arrayFilter (named)
const arrayFilter = require('lodash._arrayfilter');
import { arrayFilter } from 'lodash._arrayfilter';
This is a CommonJS module that exports a single function as its default. It does not use named exports.

Demonstrates how to import and use the internal `arrayFilter` function from this legacy Lodash v3 module using CommonJS.

const arrayFilter = require('lodash._arrayfilter'); const users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user': 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1, 'active': true } ]; // This is an internal utility and might have specific expectations. // For general use, prefer Array.prototype.filter or the main lodash `_.filter` (v4+). const activeUsers = arrayFilter(users, (user) => user.active); console.log(activeUsers); // Expected output: // [ { user: 'barney', age: 36, active: true }, { user: 'pebbles', age: 1, active: true } ]
Debug
Known issues
breakingThis package is a Lodash v3 internal utility. It is not compatible with Lodash v4+ APIs, which introduced significant breaking changes. Using it with a modern Lodash environment or expecting v4 behavior will likely lead to errors.
fix
For modern applications, use the standard `_.filter` function from the main `lodash` package (v4+) or `Array.prototype.filter` for basic array filtering. Do not mix Lodash v3 internal modules with v4+ builds.
affects: <4.0.0
deprecatedThis package represents a specific, older modular build strategy for Lodash internals. It is effectively abandoned as a standalone module in favor of using the main `lodash` package, which offers robust tree-shaking capabilities in modern bundlers, making granular imports unnecessary.
fix
Migrate to using `lodash` (the main package) and rely on your bundler's tree-shaking for optimized builds. Alternatively, use native JavaScript methods like `Array.prototype.filter`.
affects: >=3.0.0
gotchaThis module is a CommonJS-only package. Attempting to use ES module `import` syntax will result in a runtime error or build failure.
fix
Always use `require('lodash._arrayfilter')` for this package.
affects: >=3.0.0
gotchaAs an internal utility, `lodash._arrayfilter` may have specific assumptions about its execution context or arguments that differ from the public `_.filter` API, especially across major Lodash versions. Direct usage might not yield expected results without deep knowledge of Lodash v3 internals.
fix
Refer to the Lodash v3 source code for precise usage if absolutely necessary, but it is strongly recommended to use the public `_.filter` API from the appropriate Lodash version instead.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: lodash._arrayfilter is not a function
Attempting to call the imported module directly when it might be an object or undefined, or using wrong import syntax that doesn't resolve to the function.
fix
Ensure you are using `const arrayFilter = require('lodash._arrayfilter');` and then correctly invoking `arrayFilter(collection, predicate)`.
SyntaxError: Cannot use import statement outside a module
Using ES module `import` syntax (`import arrayFilter from 'lodash._arrayfilter';`) in a CommonJS environment or for a CommonJS-only package.
fix
Change your import statement to `const arrayFilter = require('lodash._arrayfilter');`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
lodash._arrayfilter — npm install lodash._arrayfilter · libregistry