Babel

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

Github星跟踪图

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;});


概览

名称与所有者babel/babel
主编程语言TypeScript
编程语言JavaScript (语言数: 6)
平台
许可证MIT License
发布数849
最新版本名称v8.0.0-alpha.8 (发布于 2024-04-04 13:08:30)
第一版名称v1.7.7 (发布于 )
创建于2014-09-28 13:38:23
推送于2024-04-26 20:55:50
最后一次提交2020-06-17 15:32:46
星数42.9k
关注者数811
派生数5.6k
提交数16.3k
已启用问题?
问题数8747
打开的问题数625
拉请求数5663
打开的拉请求数144
关闭的拉请求数1144
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

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

去到顶部