Babel

Babel是一个JavaScript编译器。(Babel is a JavaScript compiler.)

Github stars Tracking Chart

Babel是编写下一代JavaScript的编译器。Babel是一种工具链,主要用于将ECMAScript 2015+代码转换为当前和旧版浏览器或环境中的向后兼容版本的JavaScript。

Babel是一个社区驱动的工具,可帮助您在最新版本的JavaScript中编写代码。

以下是Babel可以为您做的主要事情:

  • 转换语法
  • 目标环境中缺少的Polyfill功能(通过@ babel /polyfill)
  • 源代码转换(codemods)
  • 和更多! (看看这些视频的灵感)

当您支持的环境本身不支持某些功能时,Babel将帮助您将这些功能编译为受支持的版本。

In

//ES2015 arrow function[1, 2, 3].map((n) => n + 1);

Out

[1, 2, 3].map(function(n) {  return n + 1;});


Main metrics

Overview
Name With Ownerbabel/babel
Primary LanguageTypeScript
Program languageJavaScript (Language Count: 6)
Platform
License:MIT License
所有者活动
Created At2014-09-28 13:38:23
Pushed At2025-07-04 17:16:55
Last Commit At2020-06-17 15:32:46
Release Count896
Last Release Namev8.0.0-beta.1 (Posted on 2025-07-02 08:50:17)
First Release Namev1.7.7 (Posted on )
用户参与
Stargazers Count43.6k
Watchers Count804
Fork Count5.7k
Commits Count18.1k
Has Issues Enabled
Issues Count8981
Issue Open Count596
Pull Requests Count6254
Pull Requests Open Count156
Pull Requests Close Count1194
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Babel (pronounced "babble") is a community-driven project used by many companies and projects, and is maintained by a group of volunteers. If you'd like to help support the future of the project, please consider:

Sponsors

Our top sponsors are shown below! [Become a sponsor]















Intro

Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain features natively, Babel will help you compile those features down to a supported version.

In

// ES2015 arrow function
[1, 2, 3].map((n) => n + 1);

Out

[1, 2, 3].map(function(n) {
  return n + 1;
});

Try it out at our REPL.

FAQ

Who maintains Babel?

Mostly a handful of volunteers, funded by you! Please check out our team page!

Is there a Babel song?

I'm so glad you asked: Hallelujah —— In Praise of Babel by @angus-c, audio version by @swyx. Tweet us your recordings!

Looking for support?

For questions and support please join our Slack Community (you can sign-up here for an invite), ask a question on Stack Overflow, or ping us on Twitter.

Where are the docs?

Check out our website: babeljs.io, and report issues/features at babel/website.

Want to report a bug or request a feature?

Please read through our CONTRIBUTING.md and fill out the issue template at babel/issues!

Want to contribute to Babel?

Check out:

Some resources:

How is the repo structured?

The Babel repo is managed as a monorepo that is composed of many npm packages.

License

MIT