{"id":15011729,"url":"https://github.com/preactjs/babel-plugin-transform-rename-properties","last_synced_at":"2025-10-19T13:31:51.739Z","repository":{"id":35074955,"uuid":"203778241","full_name":"preactjs/babel-plugin-transform-rename-properties","owner":"preactjs","description":"A Babel plugin for renaming JavaScript properties","archived":false,"fork":false,"pushed_at":"2023-01-09T11:23:05.000Z","size":121,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T15:32:31.682Z","etag":null,"topics":["babel","babel-plugin"],"latest_commit_sha":null,"homepage":"","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/preactjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["preactjs"],"open_collective":"preact"}},"created_at":"2019-08-22T11:09:58.000Z","updated_at":"2024-01-27T07:11:08.000Z","dependencies_parsed_at":"2023-01-15T13:18:02.381Z","dependency_job_id":null,"html_url":"https://github.com/preactjs/babel-plugin-transform-rename-properties","commit_stats":null,"previous_names":["jviide/babel-plugin-transform-rename-properties"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preactjs%2Fbabel-plugin-transform-rename-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preactjs%2Fbabel-plugin-transform-rename-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preactjs%2Fbabel-plugin-transform-rename-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preactjs%2Fbabel-plugin-transform-rename-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preactjs","download_url":"https://codeload.github.com/preactjs/babel-plugin-transform-rename-properties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237143104,"owners_count":19262132,"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":["babel","babel-plugin"],"created_at":"2024-09-24T19:41:34.328Z","updated_at":"2025-10-19T13:31:51.430Z","avatar_url":"https://github.com/preactjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/preactjs","https://opencollective.com/preact"],"categories":[],"sub_categories":[],"readme":"# babel-plugin-transform-rename-properties ![](https://github.com/preactjs/babel-plugin-transform-rename-properties/workflows/tests/badge.svg) [![npm](https://img.shields.io/npm/v/babel-plugin-transform-rename-properties.svg)](https://www.npmjs.com/package/babel-plugin-transform-rename-properties)\n\nRename JavaScript properties.\n\n## Installation\n\n```\n$ yarn add --dev babel-plugin-transform-rename-properties\n```\n\n## Example\n\nInput file:\n\n```js\nconst obj = {\n  foo: {\n    bar: 1\n  },\n  quux() {\n    return 2;\n  }\n};\n\nconst { foo } = obj;\n\nfunction quux(obj) {\n  return obj.foo.bar + obj.quux();\n}\n```\n\n`.babelrc`:\n\n```json\n{\n  \"plugins\": [\n    [\n      \"babel-plugin-transform-rename-properties\",\n      {\n        \"rename\": {\n          \"foo\": \"__FOO__\",\n          \"quux\": \"I HAVE SPACES\"\n        }\n      }\n    ]\n  ]\n}\n```\n\nOutput:\n\n```js\nconst obj = {\n  __FOO__: {\n    bar: 1\n  },\n  \"I HAVE SPACES\"() {\n    return 2;\n  }\n};\n\nconst { __FOO__: foo } = obj;\n\nfunction quux(obj) {\n  return obj.__FOO__.bar + obj[\"I HAVE SPACES\"]();\n}\n```\n\n## License\n\nThis plugin is licensed under the MIT license. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreactjs%2Fbabel-plugin-transform-rename-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreactjs%2Fbabel-plugin-transform-rename-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreactjs%2Fbabel-plugin-transform-rename-properties/lists"}