Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The xtend npm package is a utility for shallowly copying all properties from one or more source objects to a new object. It is useful for extending objects without modifying the original object, making it ideal for configurations, options, and default settings manipulation.
Extending an object
This feature allows you to combine properties from one or more source objects into a new object. The properties from the source objects are copied into the new object, with later sources' properties overwriting earlier ones.
var extend = require('xtend');
var object = extend({key1: 'value1'}, {key2: 'value2'});
console.log(object);
Similar to xtend, object-assign is used for copying the values of all enumerable own properties from one or more source objects to a target object. It uses Object.assign() method which is built-in in ES6, making it a more modern alternative to xtend.
Lodash's merge function offers deep merging capabilities, in contrast to xtend's shallow copy approach. This makes lodash.merge more suitable for complex object structures where nested properties also need to be merged.
Extend like a boss
xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.
var extend = require("xtend")
// extend returns a new object. Does not mutate arguments
var combination = extend({
a: "a",
b: "c"
}, {
b: "b"
})
// { a: "a", b: "b" }
FAQs
extend like a boss
The npm package xtend receives a total of 32,123,222 weekly downloads. As such, xtend popularity was classified as popular.
We found that xtend 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.