An open API service indexing awesome lists of open source software.

https://github.com/doowb/expand-hash

Recursively expands property keys with dot-notation into objects.
https://github.com/doowb/expand-hash

config-values dot-notation expand hash javascript keys nested-objects object objects

Last synced: 8 days ago
JSON representation

Recursively expands property keys with dot-notation into objects.

Awesome Lists containing this project

README

        

# expand-hash [![NPM version](https://img.shields.io/npm/v/expand-hash.svg?style=flat)](https://www.npmjs.com/package/expand-hash) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-hash.svg?style=flat)](https://npmjs.org/package/expand-hash) [![NPM total downloads](https://img.shields.io/npm/dt/expand-hash.svg?style=flat)](https://npmjs.org/package/expand-hash) [![Linux Build Status](https://img.shields.io/travis/doowb/expand-hash.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/expand-hash)

> Recursively expands property keys with dot-notation into objects.

Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support.

## Install

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

```sh
$ npm install --save expand-hash
```

## Usage

```js
const expand = require('expand-hash');
const obj = {
'foo.bar.bar': 'some value',
'foo.qux': 'another value',
fez: true
};

console.log(expand(obj));
// {
// foo: { bar: { bar: 'some value' }, qux: 'another value' },
// fez: true
// }
```

## About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Related projects

* [expand-object](https://www.npmjs.com/package/expand-object): Expand a string into a JavaScript object using a simple notation. Use the CLI or… [more](https://github.com/jonschlinkert/expand-object) | [homepage](https://github.com/jonschlinkert/expand-object "Expand a string into a JavaScript object using a simple notation. Use the CLI or as a node.js lib.")
* [stringify-keys](https://www.npmjs.com/package/stringify-keys): Build an array of key paths from an object. | [homepage](https://github.com/doowb/stringify-keys "Build an array of key paths from an object.")

### Contributors

| **Commits** | **Contributor** |
| --- | --- |
| 19 | [doowb](https://github.com/doowb) |
| 8 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [cconrad](https://github.com/cconrad) |

### Author

**Brian Woodward**

* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian)
* [GitHub Profile](https://github.com/doowb)
* [Twitter Profile](https://twitter.com/doowb)

### License

Copyright © 2018, [Brian Woodward](https://github.com/doowb).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 15, 2018._