{"id":15654086,"url":"https://github.com/jonschlinkert/rename-keys","last_synced_at":"2025-04-15T16:35:33.194Z","repository":{"id":13997485,"uuid":"16698704","full_name":"jonschlinkert/rename-keys","owner":"jonschlinkert","description":"Modify/rename the keys of the own enumerable properties of an object.","archived":false,"fork":false,"pushed_at":"2020-01-28T13:49:36.000Z","size":25,"stargazers_count":27,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T22:03:31.955Z","etag":null,"topics":["javascript","keys","nodejs","object","properties","rename","rename-keys"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-10T15:02:53.000Z","updated_at":"2023-06-02T20:14:21.000Z","dependencies_parsed_at":"2022-08-02T20:31:19.835Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/rename-keys","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frename-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frename-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frename-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Frename-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/rename-keys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249109312,"owners_count":21214124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","keys","nodejs","object","properties","rename","rename-keys"],"created_at":"2024-10-03T12:49:27.312Z","updated_at":"2025-04-15T16:35:33.169Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rename-keys [![NPM version](https://img.shields.io/npm/v/rename-keys.svg?style=flat)](https://www.npmjs.com/package/rename-keys) [![NPM monthly downloads](https://img.shields.io/npm/dm/rename-keys.svg?style=flat)](https://npmjs.org/package/rename-keys) [![NPM total downloads](https://img.shields.io/npm/dt/rename-keys.svg?style=flat)](https://npmjs.org/package/rename-keys) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/rename-keys.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/rename-keys)\n\n\u003e Modify the names of the own enumerable properties (keys) of an object.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save rename-keys\n```\n\n## Usage\n\n```js\nvar renameKeys = require('rename-keys');\n```\n\n## API\n\n**Params**\n\n* `object` **{Object}**: The object with keys to rename.\n* `fn` **{Function}**: Renaming function to use on each key in the object.\n* `returns` **{Object}**: Returns a new object with renamed keys.\n\n**Example**\n\n```js\nvar obj = renameKeys({a: 1, b: 2, c: 3}, function(key, val) {\n  return '--' + key;\n});\nconsole.log(obj);\n//=\u003e { '--a': 1, '--b': 2, '--c': 3}\n```\n\n**Rename based on value**\n\n```js\nvar obj = renameKeys({a: 1, b: 2, c: 3}, function(key, val) {\n  return val \u003e 1 ? ('++' + key) : ('--' + key);\n});\nconsole.log(obj);\n//=\u003e {'--a': 1, '++b': 2, '++c': 3};\n```\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 15 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 5 | [doowb](https://github.com/doowb) |\n| 2 | [stellard](https://github.com/stellard) |\n| 1 | [kof](https://github.com/kof) |\n| 1 | [robinbullocks4rb](https://github.com/robinbullocks4rb) |\n| 1 | [palanik](https://github.com/palanik) |\n\n### Building docs\n\n_(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.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 13, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Frename-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Frename-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Frename-keys/lists"}