
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
nested-obj
is a simple and lightweight JavaScript utility library for safely accessing and modifying nested properties in objects using string paths.
npm install nested-obj
Retrieve a nested property value from an object.
import objectPath from 'nested-obj';
const obj = {
user: {
name: 'John Doe',
address: {
street: '123 Main St',
city: 'Anytown'
}
}
};
const userName = objectPath.get(obj, 'user.name');
console.log(userName); // 'John Doe'
Set a value at a specific path in an object. If any part of the path does not exist, it will be created.
objectPath.set(obj, 'user.address.zip', '12345');
console.log(obj.user.address.zip); // '12345'
Check if a path exists within an object.
const hasCity = objectPath.has(obj, 'user.address.city');
console.log(hasCity); // true
To run tests, execute the following command:
npm test
or for continuous
npm test:watch
FAQs
manipulate deep objects safely and simply
The npm package nested-obj receives a total of 1,990 weekly downloads. As such, nested-obj popularity was classified as popular.
We found that nested-obj 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.