Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/paveldymkov/babel-plugin-transform-enum-literal


https://github.com/paveldymkov/babel-plugin-transform-enum-literal

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# babel-plugin-transform-enum-literal

## Example

**In**

```javascript
const EnumColor = ({
RED,
GREEN,
BLUE,
});
```

**Out**

```javascript
const EnumColor = {
RED: Symbol("RED"),
GREEN: Symbol("GREEN"),
BLUE: Symbol("BLUE")
};
```

## Installation

```sh
npm install --save-dev babel-plugin-transform-enum-literal
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
"plugins": ["babel-plugin-transform-enum-literal"]
}
```