Babel: JavaScript compiler for modern syntax
JavaScript compiler transforming modern code into browser-compatible versions via AST.
Learn more about Babel
Babel is a JavaScript transpiler that converts ECMAScript 2015+ code into backward-compatible versions for older JavaScript engines. The compiler works by parsing source code into an Abstract Syntax Tree, applying transformation plugins, and generating compatible output code. Babel operates through a plugin-based architecture where individual transformations handle specific language features like arrow functions, classes, and async/await. It is commonly integrated into build processes to support modern JavaScript development while maintaining compatibility with legacy browsers and environments.
Plugin Architecture
Modular system where individual plugins handle specific JavaScript transformations. This allows developers to configure exactly which language features to transform based on their target environments.
AST Processing
Transforms code by manipulating Abstract Syntax Trees rather than using string replacement. This approach ensures accurate transformations that preserve code semantics and handle edge cases correctly.
Preset Configurations
Bundled collections of plugins that target specific environments or use cases. Presets simplify configuration by providing curated transformation sets for common scenarios like browser compatibility or Node.js deployment.
// Input: Modern JavaScript with nullish coalescing
function greet(input) {
return input ?? "Hello world";
}
// Output: Babel transforms to compatible JavaScript
function greet(input) {
return input != null ? input : "Hello world";
}, @simbahax, and @sxzz for your first PRs!
- –`babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
- –#17659 Drop support for TS `module <identifier>` (@nicolo-ribaudo)
- –`babel-preset-env`, `babel-preset-typescript`
- –#17670 breaking(preset-env): remove `isPluginRequired` export (@JLHwung)
- –`babel-parser`
and @kolvian for your first PRs!
- –#17589 Improve Unicode handling in code-frame tokenizer (@JLHwung)
- –`babel-plugin-transform-regenerator`
- –#17556 fix: `transform-regenerator` correctly handles scope (@liuxingbaoyu)
- –`babel-plugin-transform-react-jsx`
- –#17538 fix: Keep jsx comments (@liuxingbaoyu)
* #17505 [Babel 8] Treat `allowSuperOutsideMethod` as top-level only ([@JLHwung](https://github.com/JLHwu
- –`babel-parser`
- –#17505 [Babel 8] Treat `allowSuperOutsideMethod` as top-level only (@JLHwung)
- –`babel-traverse`, `babel-types`
- –#17499 Enable `strictNullChecks` for `traverse` (@liuxingbaoyu)
- –`babel-plugin-transform-runtime`
See how people are using Babel
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
tqdm
Instrument Python iterables with minimal-overhead progress tracking.
json-server
Zero-config REST API server from JSON files.
yup
JavaScript schema validation with chainable API and type inference.
Serena
Coding agent toolkit with semantic code retrieval and editing for LLMs via MCP server.
yt-dlp
Python CLI for downloading audio/video from thousands of websites, fork of youtube-dl.