Babel (5.x) is a JavaScript compiler.

Use next generation JavaScript, today.

Babel transforms your JavaScript

You put JavaScript in

myJavaScript("foobar");

And get JavaScript out

myNewTransformedJavaScript("yay!");

ES2015 and beyond

By default, Babel ships with a set of ES2015 syntax transformers. These allow you to use new syntax, right now without waiting for browser support. Learn more →

  • Array comprehensions
  • Arrow functions
  • Async functions
  • Async generator functions
  • Classes
  • Class properties
  • Computed property names
  • Constants
  • Decorators
  • Default parameters
  • Destructuring
  • Exponentiation operator
  • For-of
  • Function bind
  • Generators
  • Generator comprehensions
  • Let scoping
  • Modules
  • Module export extensions
  • Object rest/spread
  • Property method assignment
  • Property name shorthand
  • Rest parameters
  • React
  • Spread
  • Template literals
  • Type annotations
  • Unicode regex

export default React.createClass({
  getInitialState() {
    return { num: this.getRandomNumber() };
  },

  getRandomNumber(): number {
    return Math.ceil(Math.random() * 6);
  },

  render(): any {
    return <div>
      Your dice roll:
      {this.state.num}
    </div>;
  }
});

JSX and React

Babel ships with built-in support for JSX. Use it together with the babel-sublime package to bring syntax highlighting to a whole new level.


Pluggable

Babel supports user plugins. These allow you to plug into the powerful Babel transformation layer. Learn more →

Plugins and Browsers


Who's using Babel?