Package Exports
- get-value
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-value) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
get-value

Use property paths (
a.b.c
) to get a nested value from an object.
Install
Install with npm:
$ npm install get-value --save
get-value

Use property paths (
a.b.c
) to get a nested value from an object.
Install
Install with npm:
$ npm install get-value --save
Install with bower
$ bower install get-value --save
Usage
var get = require('get-value');
var obj = {a: {b : {c: {d: 'foo'}}}, e: [{f: 'g'}]};
get(obj, 'a.b.c');
//=> {d: 'foo'}
get(obj, 'a.b.c.d');
//=> 'foo'
// works with arrays
get(obj, 'e.0.f');
//=> 'g'
Escape dots
var obj = {'foo/bar.md': {b: 'c'}};
get(obj, 'foo/bar\\.md');
//=> {b: c}
key as an array
Optionally pass the key as an array (this is useful when you need to dynamically build up the property name)
var obj = {a: {b: 'c'}};
get(obj, ['a', 'b']);
//=> 'c'
Related projects
- has-any: Returns true if an object has any of the specified keys. | homepage
- has-any-deep: Return true if
key
exists deeply on the given object. | homepage - has-value: Returns true if a value exists, false if empty. Works with deeply nested values using… more | homepage
- set-value: Create nested values and any intermediaries using dot notation (
'a.b.c'
) paths. | homepage - unset-value: Delete nested properties from an object using dot notation. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v, on March 27, 2016.
Related projects
You might also be interested in these projects:
- has-any: Returns true if an object has any of the specified keys. | homepage
- has-any-deep: Return true if
key
exists deeply on the given object. | homepage - has-value: Returns true if a value exists, false if empty. Works with deeply nested values using… more | homepage
- set-value: Create nested values and any intermediaries using dot notation (
'a.b.c'
) paths. | homepage - unset-value: Delete nested properties from an object using dot notation. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v, on March 27, 2016.