Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/paveldymkov/babel-plugin-transform-enum-literal
- Owner: PavelDymkov
- Created: 2018-12-15T14:07:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-18T09:43:33.000Z (almost 6 years ago)
- Last Synced: 2024-11-30T12:46:05.063Z (about 1 month ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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"]
}
```