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.
Utilities for setting and clearing deep object properties using mongo-style dotted paths
Simple utilities for setting, getting, and clearing object properties using mongo-style dot paths.
Install with npm:
npm install dot-get
or with bower:
bower install dot-get
In node:
var dot = require("dot-get");
var obj = {
first: {
second: 1
},
array: [1, {subobject: "good"}, 3]
};
// retrieving values
dot.get(obj, "first.second"); // <= 1
dot.get(obj, "first"); // <= {second: 1}
dot.get(obj, "missing.whatever.ok"); // <= undefined
dot.get(obj, "array.1.subobject"); // <= "good"
// setting values
dot.set(obj, "first.second", 2);
dot.set(obj, "new.key", "ok");
dot.set(obj, "array.0", {subobject: "grand"});
// clearing values
dot.clear(obj, "new.key");
dot.clear(obj, "first");
dot.clear(obj, "array.2");
// flattening objects
var obj = {
first: {
second: 1
},
array: [1, {subobject: "good"}, 3]
};
dot.flatten(obj);
console.log(obj)
{
"first.second": 1,
"array.0": 1,
"array.1.subobject": "good",
"array.2": 3
}
// Create a mongo replacement modifier for two objects.
var orig = {a: 1, b: 2};
var desired = {a: 2, c: 3};
dot.mongoReplacementModifier(desired, orig);
// {$set: {a: 2, c: 3}, $unset: {b: ""}}
FAQs
Utilities for setting and clearing deep object properties using mongo-style dotted paths
The npm package dot-get receives a total of 996 weekly downloads. As such, dot-get popularity was classified as not popular.
We found that dot-get 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.