<commit_before># get-value [![NPM version](https://img.shields.io/npm/v/get-value.svg)](https://www.npmjs.com/package/get-value) [![Build Status](https://img.shields.io/travis/jonschlinkert/get-value.svg)](https://travis-ci.org/jonschlinkert/get-value)

> Use property paths (`a.b.c`) to get a nested value from an object.

## Install

Install with [npm](https://www.npmjs.com/)

```sh
$ npm i get-value --save
```

Install with [bower](http://bower.io/)

```sh
$ bower install get-value --save
```

## Usage

```js
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**

```js
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)

```js
var obj = {a: {b: 'c'}};
get(obj, ['a', 'b']);
//=> 'c'
```

## Related projects

* [has-any](https://www.npmjs.com/package/has-any): Returns true if an object has any of the specified keys. | [homepage](https://github.com/jonschlinkert/has-any)
* [has-any-deep](https://www.npmjs.com/package/has-any-deep): Return true if `key` exists deeply on the given object.  | [homepage](https://github.com/jonschlinkert/has-any-deep)
* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value)
* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value)
* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/get-value/issues/new).

## Running tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Author

**<NAME>**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2014-2015 [<NAME>](https://github.com/jonschlinkert)
Released under the MIT license.

***

_This file was generated by [verb](https://github.com/verbose/verb) on December 10, 2015._<commit_msg>generate readme again with layout<commit_after># get-value [![NPM version](https://img.shields.io/npm/v/get-value.svg)](https://www.npmjs.com/package/get-value) [![Build Status](https://img.shields.io/travis/jonschlinkert/get-value.svg)](https://travis-ci.org/jonschlinkert/get-value)

> Use property paths (`a.b.c`) to get a nested value from an object.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm i get-value --save
```

Install with [bower](http://bower.io/)

```sh
$ bower install get-value --save
```

## Usage

```js
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**

```js
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)

```js
var obj = {a: {b: 'c'}};
get(obj, ['a', 'b']);
//=> 'c'
```

## Related projects

* [has-any](https://www.npmjs.com/package/has-any): Returns true if an object has any of the specified keys. | [homepage](https://github.com/jonschlinkert/has-any)
* [has-any-deep](https://www.npmjs.com/package/has-any-deep): Return true if `key` exists deeply on the given object.  | [homepage](https://github.com/jonschlinkert/has-any-deep)
* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value)
* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value)
* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/get-value/issues/new).

## Running tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Author

**<NAME>**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2014-2016 [<NAME>](https://github.com/jonschlinkert)
Released under the MIT license.

***

_This file was generated by [verb](https://github.com/verbose/verb) on January 19, 2016._
{'fraction_non_alphanumeric': 0.20398481973434535, 'fraction_numerical': 0.0056925996204933585, 'mean_word_length': 4.255234297108674, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 40, 'lorem ipsum': 0, 'www.': 16, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5718713', 'n_tokens_mistral': 2007, 'n_tokens_neox': 1892, 'n_words': 463}