# generator-babel

> Yeoman generator to setup Babel effortlessly (with plugins, if you want)

Latest version **2.0.2** (published 2016-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install generator-babel
pnpm add generator-babel
yarn add generator-babel
bun add generator-babel
```

## 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 | 2.0.2 |
| Published | 2016-03-15 |
| First published | 2015-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | Vladimir Starkov |
| Maintainers | iamstarkov |
| Keywords | yeoman-generator, babel, babeljs, compiler, compilation, transpiler, transpilation, es6, es2015, boilerplate, node, starter, kit, yeoman, plugin, boilerplate, template, scaffold, module, node_module, node-module, travis, javascript, npm |

## Links

- npm: https://www.npmjs.com/package/generator-babel
- Repository: https://github.com/iamstarkov/generator-babel
- Homepage: https://github.com/iamstarkov/generator-babel#readme
- Issues: https://github.com/iamstarkov/generator-babel/issues
- npm.io page: https://npm.io/package/generator-babel

## Dependencies (5)

- [ramda](https://npm.io/package/ramda.md) ^0.19.1
- [deps-object](https://npm.io/package/deps-object.md) ^2.0.0
- [sorted-object](https://npm.io/package/sorted-object.md) ^2.0.0
- [split-keywords](https://npm.io/package/split-keywords.md) ^2.0.0
- [yeoman-generator](https://npm.io/package/yeoman-generator.md) ^0.22.5

## 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

- 2.0.2 (latest) — 2016-03-15
- 2.0.1 — 2016-03-13
- 2.0.0 — 2016-03-04
- 1.1.3 — 2016-02-29
- 1.1.2 — 2016-02-12
- 1.1.1 — 2016-02-10
- 1.1.0 — 2016-02-09
- 1.0.4 — 2016-02-01
- 1.0.3 — 2015-11-11
- 1.0.2 — 2015-11-11

## README

# generator-babel

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Dependency Status][depstat-image]][depstat-url]

> [Yeoman][yo] generator to setup [Babel][babel] effortlessly (with plugins, if you want).  
> Works great as [cli](#usage) and [with other generators too](#composability).

By default, Babel doesn’t do anything! You need to configure it. So this package will create Babel’s configuration file `.babelrc` with default `es2015` preset and install required `babel-cli`, `babel-core` to devDependencies in your project.

After this package’s work is finished, you can access `babel-cli` and `babel-register` from your npm scripts. It’s useful for:
* **[transpilation][babel-cli]:** `babel index.js --out-file index.es5.js`
* **testing** via [hook][babel-register]: `mocha --require babel-register`, `tape test.js --require babel-register`, etc.

[yo]: http://yeoman.io/
[babel]: https://babeljs.io/
[babel-cli]: https://babeljs.io/docs/usage/cli/#babel
[babel-register]: https://babeljs.io/docs/setup/#babel_register
[babel-node]: https://babeljs.io/docs/usage/cli/#babel-node

## Install

    npm install --global yo generator-babel

## Usage

    # default es2015 preset
    yo babel

    # your favorite presets
    yo babel es2015 stage-0

    # with plugins with --plugins/-p
    yo babel -p add-module-exports
    yo babel -p transform-strict-mode,transform-object-assign

The entire range of [Babel presets][babel-presets] are allowed.

[babel-presets]: http://babeljs.io/docs/plugins/#presets

## Composability

> Composability is a way to combine smaller parts to make one large thing. Sort of [like Voltron®][voltron]  
> — [Yeoman docs](http://yeoman.io/authoring/composability.html)

Just plug in _babel_ into your generator and let it setup your `.babelrc` and install required `devDependencies` for you. Everybody wins.

### Install

    npm install --save generator-babel

#### Compose

`skip-install` is used because `babel` install babel deps for you
and you don’t need to test it in your own generator tests.

```js
this.composeWith('babel', { options: {
  'skip-install': this.options['skip-install']
}}, {
  local: require.resolve('generator-babel/generators/app')
});
```

Add any extra fields you need to `options.config` to extend the [default][defaults] configuration. The entire range of [Babel options][babel-options] are allowed.

```js
this.composeWith('babel', { options: {
  'skip-install': this.options['skip-install'],
  config: {
    presets: ['es2015', 'stage-0'],
    plugins: ['transform-strict-mode', 'transform-object-assign'],
    sourceMaps: true
  }
}}, {
  local: require.resolve('generator-babel')
});
```

Required list of `presets` and `plugins` will be installed to `devDependencies` into your project with proper names: `es2015` will be `babel-preset-es2015` and `transform-strict-mode` will be `babel-plugin-transform-strict-mode`.

[babel-options]: http://babeljs.io/docs/usage/options/
[defaults]: https://github.com/iamstarkov/generator-babel/blob/master/generators/app/templates/_babelrc
[voltron]: http://25.media.tumblr.com/tumblr_m1zllfCJV21r8gq9go11_250.gif

## License

MIT © [Vladimir Starkov](https://iamstarkov.com)

[npm-url]: https://npmjs.org/package/generator-babel
[npm-image]: https://img.shields.io/npm/v/generator-babel.svg?style=flat

[travis-url]: https://travis-ci.org/iamstarkov/generator-babel
[travis-image]: https://img.shields.io/travis/iamstarkov/generator-babel.svg?style=flat

[depstat-url]: https://david-dm.org/iamstarkov/generator-babel
[depstat-image]: https://david-dm.org/iamstarkov/generator-babel.svg?style=flat

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