Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 29, 2024 via pnpm

get-value 3.0.1

Use property paths like 'a.b.c' to get a nested value from an object. Even works when keys have dots in them (no other dot-prop library can do this!).
Package summary
Share
0
issues
1
license
2
MIT
Package created
6 Oct 2014
Version published
7 Mar 2018
Maintainers
2
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
get-value@3.0.1
isobject@3.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
ⓘ This is a list of get-value 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
isobject3.0.12.77 kBMIT
prod

Visualizations

Frequently Asked Questions

What does get-value do?

Get-Value is a powerful JavaScript utility that allows developers to extract nested values from an object using property paths like 'a.b.c'. The library uniquely also supports keys that include dots, which sets it apart from other dot-prop libraries. It's a fast and efficient tool that enables more advanced object manipulation — it can function with arrays, functions, and can even handle default options when a value can't be resolved in your provided JavaScript object.

How do you use get-value?

To use Get-Value, you would first need to install the package using npm with the command npm install --save get-value. After installation, you can use it in your JavaScript file as per the following examples:

const get = require('get-value');
const obj = { a: { b: { c: { d: 'foo' } } } };

console.log(get(obj));            //=> { a: { b: { c: { d: 'foo' } } } };
console.log(get(obj, 'a'));       //=> { b: { c: { d: 'foo' } } }
console.log(get(obj, 'a.b'));     //=> { c: { d: 'foo' } }
console.log(get(obj, 'a.b.c'));   //=> { d: 'foo' }
console.log(get(obj, 'a.b.c.d')); //=> 'foo'

Where are the get-value docs?

The complete documentation and additional usage options for Get-Value can be found on the GitHub page. The README file contains a comprehensive guide, starting with installation and usage instructions, followed by further details on support features and optimization options. This includes examples of using Get-Value with keys that include dots, arrays, and functions, as well as how to pass the object path as an array for increased performance. The documentation also delves into custom options that users can utilize, like defining a default return value or customizing how the object path is split.