Plucker
Pluck nested properties from an object
Install / Use
/learn @hughsk/PluckerREADME
plucker 

Pluck nested properties from an object.
Usage
const plucker = require('plucker')
const pluck = plucker('foo.bar')
pluck({ foo: { bar: 'hello' } })
// => 'hello'
API
pluck = plucker(path)
Given a dot-delimted property path, returns a plucking function.
You can also pass in an array of string keys, in case you want to avoid splitting a key which is intended to have dots in it.
pluck(object)
Pass this function an object to pluck the nested value from it.
To pluck values from an array, you can simply use it with [].map, like so:
var pluck = require('plucker')
var array = require('./data.json')
return array.map(
pluck('some.nested.value')
)
plucker(path, object)
Shorthand for plucker(path)(object).
See Also
- flat - Flatten/unflatten nested Javascript objects
License
MIT. See LICENSE.md for details.
Related Skills
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR

