
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
object-pluck
Advanced tools
Helps pluck multiple values out of an object and deposits them into a new object, optionally under a specific key. Allows chaining and plucking from an array of objects.
npm install object-pluck --save
pluck(['keyName1', 'keyName2'], fromObject, 'optionalNamespace').end();
.end() returns the final object. Failing to end the pluck would be catastrophic.
const pluck = require('object-pluck');
const object = {
a: 1,
b: 2,
c: 3,
nest: {
d: 4,
e: 5,
},
array: [
{
lame: 'sauce',
proto: 'buff',
},
{
lame: 'dance',
proto: 'rage',
}
]
};
// standard plucking (pretty much just destructing)
pluck(['a', 'c'], object).end(); // { a: 1, c: 3 }
// namespacing
pluck(['a', 'b'], object, 'foo').end();
// returns { foo: { a: 1, b: 2 } }
// chaining
pluck(['a', 'c'], object, 'foo').pluck(['d', 'e'], object.nest, 'bar').end();
// returns { foo: { a: 1, c: 3 }, bar: { d: 4, e: 5 } }
// plucks from an array of objects too (requires a namespace)
pluck(['lame', 'proto'], object.array, 'fromArray').end();
// returns { fromArray: [ { lame: 'sauce', proto: 'buff' }, { lame: 'dance', proto: 'rage' } ] }
FAQs
pluck values from an object and deposit them into a new object
We found that object-pluck demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.