You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pathval

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pathval

Object value retrieval given a string path

2.0.1
latest
Source
npmnpm
Version published
Weekly downloads
21M
-3.9%
Maintainers
1
Weekly downloads
 
Created

What is pathval?

The pathval npm package is a utility for working with object paths. It allows you to get and set values on an object using a string path, which is useful for accessing deeply nested properties.

What are pathval's main functionalities?

Get value from object

This feature allows you to retrieve a value from a nested object using a string path.

{"const pathval = require('pathval');
const obj = { a: { b: { c: 'd' } } };
const value = pathval.get(obj, 'a.b.c');
console.log(value); // Output: 'd'"}

Set value on object

This feature allows you to set a value on a nested object using a string path, creating any necessary sub-objects along the path.

{"const pathval = require('pathval');
const obj = {};
pathval.set(obj, 'a.b.c', 'd');
console.log(obj); // Output: { a: { b: { c: 'd' } } }"}

Other packages similar to pathval

Keywords

pathval

FAQs

Package last updated on 25 Jun 2025

Did you know?

Socket

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.

Install

Related posts