{"id":13485,"library":"lodash.pluck","title":"lodash.pluck module","description":"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.","status":"deprecated","version":"3.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/lodash/lodash","tags":["javascript","lodash","lodash-modularized","stdlib","util"],"install":[{"cmd":"npm install lodash.pluck","lang":"bash","label":"npm"},{"cmd":"yarn add lodash.pluck","lang":"bash","label":"yarn"},{"cmd":"pnpm add lodash.pluck","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a CommonJS module and does not provide ESM exports. `_.pluck` was deprecated in Lodash v4.","wrong":"import pluck from 'lodash.pluck';","symbol":"pluck","correct":"const pluck = require('lodash.pluck');"}],"quickstart":{"code":"const pluck = require('lodash.pluck');\n\nconst users = [\n  { user: 'barney', age: 36, active: true },\n  { user: 'fred', age: 40, active: false },\n  { user: 'pebbles', age: 1, active: true }\n];\n\n// Using lodash.pluck to extract an array of 'user' names\nconst userNames = pluck(users, 'user');\nconsole.log('User names:', userNames);\n// Expected output: ['barney', 'fred', 'pebbles']\n\n// Using lodash.pluck to extract an array of 'age' values\nconst ages = pluck(users, 'age');\nconsole.log('Ages:', ages);\n// Expected output: [36, 40, 1]\n","lang":"javascript","description":"Demonstrates how to import `lodash.pluck` using CommonJS and use it to extract property values from an array of objects."},"warnings":[{"fix":"Migrate to `_.map` from the main `lodash` package. For example, `pluck(collection, 'prop')` becomes `_.map(collection, 'prop')`.","message":"The `_.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')`).","severity":"deprecated","affected_versions":">=3.0.0"},{"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.","message":"This `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.","severity":"breaking","affected_versions":">=3.1.2"},{"fix":"Always use `const pluck = require('lodash.pluck');` for compatibility. Better yet, migrate to `lodash` or `lodash-es` which offer ESM support for `_.map`.","message":"This 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.","severity":"gotcha","affected_versions":">=3.1.2"}],"env_vars":null,"search_vec":"'2015':60 '3.1.2':32 '4':47 'align':34 'allow':100 'broader':86 'bundl':112 'cadenc':73 'codebas':121 'commonj':25 'comprehens':19 'core':82 'current':29 'deprec':55,79 'develop':101 'differenti':97 'dormant':76 'ecosystem':88 'effect':75 'environ':116 'explicit':125 'favor':62 'full':110 'function':14,52,83 'includ':103 'javascript':127 'legaci':120 'librari':21,41 'lodash':20,36,40,57,87,111,128,130 'lodash-modular':129 'lodash.pluck':1,3 'main':39 'maintain':119 'mani':93 'map':65 'mirror':77 'modul':2,26 'modular':131 'move':44 'npm':7 'older':115 'origin':15 'packag':8,70 'part':16 'pluck':12,51,123 'primari':96 'properti':67 'provid':10 'releas':59,72 'shorthand':68 'sinc':43 'special':6 'specif':106 'standalon':24 'stdlib':132 'suitabl':113 'updat':91 'use':64,126 'util':13,107,133 'v3':37 'v4':58 'version':31,46 'within':84 'without':108 'x':48 'year':94","created_at":"2026-04-20T01:54:44.748861+00:00","updated_at":"2026-04-20T01:54:44.748861+00:00","problems":[{"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`.","cause":"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.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'lodash.pluck' imported from ..."},{"fix":"Verify installation and import path. If using a newer `lodash` installation (v4+), use `_.map` instead: `import { map } from 'lodash'; map(collection, 'property');`.","cause":"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.","error":"TypeError: pluck is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://lodash.com/","github":"https://github.com/lodash/lodash","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/lodash.pluck","openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}