Registry / data / lodash.pluck

lodash.pluck

JSON →
library3.1.2jsnpmunverified

lodash.pluck is a specialized npm package that provides the `_.pluck` utility function, originally part of the comprehensive Lodash library, as a standalone CommonJS module. It is currently at version 3.1.2, which aligns with Lodash v3. The main Lodash library has since moved to version 4.x, and the `_.pluck` function itself was deprecated in Lodash v4 (released 2015) in favor of using `_.map` with property shorthands. This package's release cadence is effectively dormant, mirroring the deprecation of its core functionality within the broader Lodash ecosystem, with no updates in many years. Its primary differentiator was to allow developers to include only this specific utility without the full Lodash bundle, suitable for older environments or for maintaining legacy codebases where `_.pluck` was explicitly used.

npm install lodash.pluck
INSTALL
IMPORT
SIG · LODASH.PLUCK
L
lodash.pluck
datajavascriptv3.1.2
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

pluck
✓ const pluck = require('lodash.pluck');
✗ import pluck from 'lodash.pluck';
This package is a CommonJS module and does not provide ESM exports. `_.pluck` was deprecated in Lodash v4.

Demonstrates how to import `lodash.pluck` using CommonJS and use it to extract property values from an array of objects.

const pluck = require('lodash.pluck'); const users = [ { user: 'barney', age: 36, active: true }, { user: 'fred', age: 40, active: false }, { user: 'pebbles', age: 1, active: true } ]; // Using lodash.pluck to extract an array of 'user' names const userNames = pluck(users, 'user'); console.log('User names:', userNames); // Expected output: ['barney', 'fred', 'pebbles'] // Using lodash.pluck to extract an array of 'age' values const ages = pluck(users, 'age'); console.log('Ages:', ages); // Expected output: [36, 40, 1]
Debug
Known issues
deprecatedThe `_.pluck` function, which this module provides, was deprecated in Lodash v4 (released in 2015). It has been superseded by `_.map` using property shorthand (e.g., `_.map(collection, 'property')`).
fix
Migrate to `_.map` from the main `lodash` package. For example, `pluck(collection, 'prop')` becomes `_.map(collection, 'prop')`.
affects: >=3.0.0
breakingThis `lodash.pluck` package is stuck at version 3.1.2, aligning with Lodash v3. It does not receive updates and is not compatible with modern JavaScript module systems (ESM) or the latest features/fixes in the main Lodash v4.x line.
fix
Avoid using this standalone package. Install the full `lodash` or `lodash-es` package and use `_.map` instead. This ensures you benefit from ongoing maintenance, security patches, and ESM compatibility.
affects: >=3.1.2
gotchaThis package is a CommonJS-only module. Attempting to import it using ES module syntax (e.g., `import pluck from 'lodash.pluck'`) will result in runtime errors in environments that enforce strict ESM or in build systems not configured to transpile CommonJS.
fix
Always use `const pluck = require('lodash.pluck');` for compatibility. Better yet, migrate to `lodash` or `lodash-es` which offer ESM support for `_.map`.
affects: >=3.1.2
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'lodash.pluck' imported from ...
Attempting to use `import` syntax (ES Modules) in a Node.js environment or bundler that expects CommonJS modules for `lodash.pluck`, or the package is not installed.
fix
Ensure the package is installed (`npm install lodash.pluck`) and use CommonJS `require`: `const pluck = require('lodash.pluck');`. For modern applications, consider migrating to `lodash` and using `_.map`.
TypeError: pluck is not a function
This usually happens if `require('lodash.pluck')` did not successfully resolve to the function, often due to an incorrect import or the module itself being corrupted/missing, or trying to access `_.pluck` from a modern `lodash` installation that no longer exposes it directly.
fix
Verify installation and import path. If using a newer `lodash` installation (v4+), use `_.map` instead: `import { map } from 'lodash'; map(collection, 'property');`.
Upgrade
Version history
3.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

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