https://github.com/hiroppy/babel-init
Setup .babelrc using command.
https://github.com/hiroppy/babel-init
Last synced: about 1 month ago
JSON representation
Setup .babelrc using command.
- Host: GitHub
- URL: https://github.com/hiroppy/babel-init
- Owner: hiroppy
- License: mit
- Created: 2016-12-26T20:43:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-08-17T02:31:34.000Z (almost 6 years ago)
- Last Synced: 2025-03-21T01:28:41.812Z (about 1 year ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-init
[](https://travis-ci.org/abouthiroppy/babel-init)
Setup `.babelrc` using command.
## Install
```sh
$ npm install -g babel-init
```
## Usage
```sh
$ npm init --yes #if you havn't made package.json
$ babel-init
Select presets and plugins!
```

Plugin List: https://babeljs.io/docs/plugins/
### output
```sh
? Select presets latest, stage-0
? Select plugins syntax-flow and transform-flow-strip-types
```
`.babelrc`
```json
{
"env": {},
"ignore": [],
"plugins": [
"syntax-flow",
"transform-flow-strip-types"
],
"presets": [
"latest",
"stage-0"
]
}
```
## Customize
### .babelinitrc
You can use `.babelinitrc`.
You put it on home or project root directory.
babel-init read this files and creating the select box.
```json
{
"presets": [],
"plugins": []
}
```
The following is a sample file.
```json
{
"presets": [],
"plugins": [
{
"name": "syntax-flow and transform-flow-strip-types",
"value": "syntax-flow,transform-flow-strip-types"
},
"lodash",
"transform-runtime"
]
}
```
`name` is the words displayed in the select box.
`value` is an installed package name. (same meaning as only string in array)