@aws/pdk
Version:
All documentation is located at: https://aws.github.io/aws-pdk
69 lines (43 loc) • 2.79 kB
Markdown
# deep-rename-keys [](https://www.npmjs.com/package/deep-rename-keys) [](https://npmjs.org/package/deep-rename-keys) [](https://npmjs.org/package/deep-rename-keys) [](https://travis-ci.org/jonschlinkert/deep-rename-keys)
> Recursively rename the keys in an object.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save deep-rename-keys
```
## Usage
```js
var rename = require('deep-rename-keys');
var obj = rename({a: {a: {a: 'b'}}}, function(key) {
if (key === 'a') return 'zzz';
return key;
});
//=> {zzz: {zzz: {zzz: 'b'}}}
```
## About
### Related projects
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
* [rename-keys](https://www.npmjs.com/package/rename-keys): Modify the names of the own enumerable properties (keys) of an object. | [homepage](https://github.com/jonschlinkert/rename-keys "Modify the names of the own enumerable properties (keys) of an object.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### 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
```
### 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
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on April 03, 2017._