­čîť
­čî×
@babel/types

@babel/types

v7.18.10

Babel Types is a Lodash-esque utility library for AST nodes

npm install @babel/types

README

babel

The compiler for writing next generation JavaScript.

Gitpod ready-to-code

v7 npm Downloads v6 npm Downloads

GitHub CI Status Coverage Status Slack Status Follow on Twitter

Supporting Babel

Backers on Open Collective Sponsors on Open Collective Business Strategy Status

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:

  • Giving developer time on the project. (Message us on Twitter or Slack for guidance!)
  • Giving funds by becoming a sponsor on Open Collective or GitHub (which goes to our Open Collective account)!

Sponsors

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

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

// ES2020 nullish coalescing
function greet(input) {
  return input ?? "Hello world";
}

Out

function greet(input) {
  return input != null ? input : "Hello world";
}

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

Release Notes

7.18.10
By Babel Bot ÔÇó Published on August 1, 2022

v7.18.10 (2022-08-01)

:rocket: New Feature

  • babel-helper-string-parser, babel-types

:bug: Bug Fix

  • babel-parser
    • #14817 fix(parser): allow TS declare readonly fields with initializers (@Josh-Cena)
  • babel-helper-string-parser, babel-parser
  • babel-plugin-transform-typescript
  • babel-plugin-transform-react-jsx
  • babel-generator
  • babel-helper-wrap-function, babel-plugin-transform-async-to-generator, babel-traverse

:house: Internal

:microscope: Output optimization

  • babel-plugin-proposal-export-default-from

Committers: 10

7.18.9
By Babel Bot ÔÇó Published on July 18, 2022

v7.18.9 (2022-07-18)

:bug: Bug Fix

  • babel-plugin-transform-modules-systemjs, babel-types
  • babel-generator

:nail_care: Polish

:house: Internal

  • babel-core, babel-helper-remap-async-to-generator, babel-helpers, babel-parser, babel-plugin-transform-block-scoping, babel-preset-env
  • babel-helper-create-class-features-plugin, babel-helper-member-expression-to-functions, babel-helper-remap-async-to-generator, babel-helper-replace-supers, babel-helper-wrap-function, babel-helpers, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-decorators, babel-plugin-proposal-object-rest-spread, babel-plugin-proposal-optional-chaining, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-traverse, babel-types

:running_woman: Performance

Committers: 5

7.18.8
By Babel Bot ÔÇó Published on July 8, 2022

v7.18.8 (2022-07-08)

Thanks @dbacarel for your first PR!

:eyeglasses: Spec Compliance

  • babel-parser, babel-types

:bug: Bug Fix

  • babel-plugin-transform-parameters
  • babel-plugin-transform-classes
  • babel-plugin-transform-for-of, babel-plugin-transform-spread, babel-traverse, babel-types
  • babel-helper-module-transforms, babel-plugin-transform-modules-commonjs

:memo: Documentation

:house: Internal

  • babel-types
  • Other
    • #14720 fix: support compiling monorepo on single-core CPU machines (@JLHwung)
  • babel-helper-fixtures, babel-parser

:microscope: Output optimization

  • babel-plugin-transform-typescript

Committers: 7

7.18.7
By Babel Bot ÔÇó Published on June 28, 2022

v7.18.7 (2022-06-28)

:bug: Bug Fix

Committers: 2

7.18.6
By Babel Bot ÔÇó Published on June 27, 2022

v7.18.6 (2022-06-27)

:eyeglasses: Spec Compliance

  • babel-parser
  • babel-generator, babel-parser, babel-preset-env, babel-template

:bug: Bug Fix

  • babel-helper-remap-async-to-generator, babel-plugin-proposal-async-generator-functions
  • babel-plugin-transform-parameters
  • babel-core
  • babel-core, babel-helper-check-duplicate-nodes, babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-destructuring-private, babel-plugin-proposal-optional-chaining, babel-plugin-transform-runtime

:house: Internal

  • babel-standalone
  • Other
  • babel-generator, babel-types
  • babel-code-frame, babel-core, babel-generator, babel-helper-annotate-as-pure, babel-helper-builder-binary-assignment-operator-visitor, babel-helper-builder-react-jsx, babel-helper-check-duplicate-nodes, babel-helper-compilation-targets, babel-helper-create-class-features-plugin, babel-helper-create-regexp-features-plugin, babel-helper-define-map, babel-helper-explode-assignable-expression, babel-helper-fixtures, babel-helper-function-name, babel-helper-hoist-variables, babel-helper-member-expression-to-functions, babel-helper-module-imports, babel-helper-module-transforms, babel-helper-optimise-call-expression, babel-helper-plugin-test-runner, babel-helper-plugin-utils, babel-helper-remap-async-to-generator, babel-helper-replace-supers, babel-helper-simple-access, babel-helper-split-export-declaration, babel-helper-transform-fixture-test-runner, babel-helper-validator-option, babel-helper-wrap-function, babel-helpers, babel-highlight, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-external-helpers, babel-plugin-proposal-async-generator-functions, babel-plugin-proposal-class-static-block, babel-plugin-proposal-decorators, babel-plugin-proposal-destructuring-private, babel-plugin-proposal-function-bind, babel-plugin-proposal-function-sent, babel-plugin-proposal-json-strings, babel-plugin-proposal-object-rest-spread, babel-plugin-proposal-optional-chaining, babel-plugin-proposal-partial-application, babel-plugin-proposal-pipeline-operator, babel-plugin-proposal-private-property-in-object, babel-plugin-proposal-record-and-tuple, babel-plugin-syntax-typescript, babel-plugin-transform-block-scoped-functions, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-computed-properties, babel-plugin-transform-destructuring, babel-plugin-transform-duplicate-keys, babel-plugin-transform-exponentiation-operator, babel-plugin-transform-flow-comments, babel-plugin-transform-flow-strip-types, babel-plugin-transform-for-of, babel-plugin-transform-function-name, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-systemjs, babel-plugin-transform-modules-umd, babel-plugin-transform-object-super, babel-plugin-transform-parameters, babel-plugin-transform-property-mutators, babel-plugin-transform-proto-to-assign, babel-plugin-transform-react-constant-elements, babel-plugin-transform-react-display-name, babel-plugin-transform-react-inline-elements, babel-plugin-transform-react-jsx-compat, babel-plugin-transform-react-jsx-source, babel-plugin-transform-react-jsx, babel-plugin-transform-runtime, babel-plugin-transform-typescript, babel-plugin-transform-unicode-escapes, babel-preset-env, babel-preset-typescript, babel-standalone, babel-template, babel-traverse, babel-types
  • babel-core, babel-helper-transform-fixture-test-runner, babel-plugin-transform-destructuring

Committers: 6

7.18.4
By Babel Bot ÔÇó Published on May 29, 2022

v7.18.4 (2022-05-29)

:eyeglasses: Spec Compliance

  • babel-types
    • #14591 fix: remove TSDeclareFunction from ExportDefaultDeclaration (@JLHwung)

:bug: Bug Fix

  • babel-plugin-transform-typescript
  • babel-parser
  • babel-helper-check-duplicate-nodes, babel-parser

:house: Internal

  • babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-modules-systemjs

Committers: 3

7.18.2
By Babel Bot ÔÇó Published on May 25, 2022

v7.18.2 (2022-05-25)

:bug: Bug Fix

  • babel-plugin-transform-template-literals
    • #14582 fix: skip template literal transform for TSLiteralType (@JLHwung)
  • babel-helpers
  • babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-helper-environment-visitor, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-proposal-decorators, babel-traverse, babel-types
    • #14371 environmentVisitor should skip decorator expressions (@JLHwung)

:memo: Documentation

:house: Internal

Committers: 4

General

License
MIT
Typescript Types
Built-in
Tree-shakeable
No

Popularity

GitHub Stargazers
41.4K
Community Interest
44.1K
Number of Forks
5,455

Maintenance

Commits
10/219/22070
Last Commit
Open Issues
628
Closed Issues
7,633
Open Pull Requests
149
Closed Pull Requests
1,045

Versions

Versions Released
10/219/2204
Latest Version Released
Aug 1, 2022
Current Tags
latest7.18.10

Contributors

sebmck
sebmck
Commits: 5,192
hzoo
hzoo
Commits: 1,264
nicolo-ribaudo
nicolo-ribaudo
Commits: 622
loganfsmyth
loganfsmyth
Commits: 594
existentialism
existentialism
Commits: 469
danez
danez
Commits: 433
JLHwung
JLHwung
Commits: 385
marijnh
marijnh
Commits: 264
RReverser
RReverser
Commits: 233
jamiebuilds
jamiebuilds
Commits: 224
amasad
amasad
Commits: 172
jridgewell
jridgewell
Commits: 159
xtuc
xtuc
Commits: 106
yavorsky
yavorsky
Commits: 89
babel-bot
babel-bot
Commits: 86