# babel-plugin-transform-property-literals

> Turn valid property key literals to plain identifiers

Latest version **6.9.4** (published 2018-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-property-literals
pnpm add babel-plugin-transform-property-literals
yarn add babel-plugin-transform-property-literals
bun add babel-plugin-transform-property-literals
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.9.4 |
| Published | 2018-05-14 |
| First published | 2015-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4372 |
| Author | amasad |
| Maintainers | babeljs, boopathi, hzoo, loganfsmyth, vignesh.shanmugam |
| Keywords | babel-plugin |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-property-literals
- Repository: https://github.com/babel/minify/tree/master/packages/babel-plugin-transform-property-literals
- Homepage: https://github.com/babel/minify#readme
- Issues: https://github.com/babel/minify/issues
- npm.io page: https://npm.io/package/babel-plugin-transform-property-literals

## Dependencies (1)

- [esutils](https://npm.io/package/esutils.md) ^2.0.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 6.9.4 (latest) — 2018-05-14
- 6.10.0-alpha.9 (canary) — 2018-09-23
- 0.0.3 (prerelease) — 2016-11-18
- 6.10.0-alpha.3cc09dcf — 2018-07-27
- 6.10.0-alpha.beb87b9a — 2018-07-26
- 6.10.0-alpha.5a128fd5 — 2018-07-17
- 6.10.0-alpha.2ed85317 — 2018-07-17
- 6.10.0-alpha.a24dd066 — 2018-06-11
- 6.10.0-alpha.2e0de171 — 2018-06-01
- 6.10.0-alpha.89fc69da — 2018-06-01
- 6.10.0-alpha.41ef96a2 — 2018-06-01
- 6.10.0-alpha.a28b6b00 — 2018-05-22
- 6.10.0-alpha.2ec8ff72 — 2018-05-22
- 6.10.0-alpha.01eac1c3 — 2018-05-17
- 6.10.0-alpha.5dbc73f7 — 2018-05-17
- … 75 more at https://npm.io/package/babel-plugin-transform-property-literals/versions

## README

# babel-plugin-transform-property-literals

This plugin allows Babel to transform valid identifier property key literals into identifiers.

## Example

**In**

```javascript
var foo = {
  // changed
  "bar": function () {},
  "1": function () {},

  // not changed
  "default": 1,
  [a]: 2,
  foo: 1
};
```

**Out**

```javascript
var foo = {
  bar: function () {},
  1: function () {},

  "default": 1,
  [a]: 2,
  foo: 1
};
```

## Installation

```sh
npm install babel-plugin-transform-property-literals --save-dev
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["transform-property-literals"]
}
```

### Via CLI

```sh
babel --plugins transform-property-literals script.js
```

### Via Node API

```javascript
require("@babel/core").transform("code", {
  plugins: ["transform-property-literals"]
});
```

---
_Source: https://npm.io/package/babel-plugin-transform-property-literals · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
