{
 "kind": "tool",
 "slug": "babel-npm",
 "path": "tools/babel-npm/",
 "name": "Babel (JavaScript)",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Build tools and bundlers",
   "tools/build-tools/"
  ]
 ],
 "lead": "Rewrite new JavaScript for older browsers.",
 "chips": [
  {
   "label": "Build tools and bundlers",
   "path": "tools/build-tools/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install @babel/core"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/babel/babel"
  },
  {
   "label": "Website",
   "href": "https://babel.dev/docs/en/next/babel-core"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/babel/babel/blob/main/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Nov 20, 2026. ",
   "src": "https://github.com/babel/babel"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "230 projects",
   "status": "info",
   "sub": "#4 of 185 in its category",
   "note": "Dependency in 230 public GitHub projects set up for AI coding agents that we scanned (3.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Babel (JavaScript) does",
   "parts": [
    {
     "t": "prose",
     "text": "Babel is a free tool that rewrites JavaScript before it ships. It turns newer code, React's JSX tags and TypeScript into plain JavaScript that the browsers you choose can run. Most people never call it directly; a build or test tool runs it for them."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Support older phones and browsers",
       "text": "Your shop still has visitors on older iPhones; Babel rewrites newer code such as ?. and ?? so their browsers can run it.",
       "idea": false
      },
      {
       "title": "TypeScript and JSX without the TypeScript compiler",
       "text": "A React component written in TypeScript becomes plain JavaScript in one step. Types are removed, not checked, so the build stays quick.",
       "idea": false
      },
      {
       "title": "Run user code in a playground",
       "text": "A coding lesson site or an online sandbox compiles what visitors type, right in their browser, with no server.",
       "idea": false
      },
      {
       "title": "Clean up code across a project",
       "text": "Remove every leftover debug print, rename an old function everywhere, or change an import style in hundreds of files with one small rule.",
       "idea": false
      },
      {
       "title": "List what a file imports",
       "text": "A script reads each source file as a tree and reports which packages it imports, for a cleanup or a security review.",
       "idea": false
      },
      {
       "title": "New React features in an existing build",
       "text": "Tools such as the React Compiler ship as Babel plugins, so a project that already uses Babel adds them with one config line.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Babel (JavaScript) popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "84",
       "of": "/ 100",
       "l": "Gid Score, #47 overall"
      },
      {
       "n": "271M",
       "l": "downloads a week, npm"
      },
      {
       "n": "44.1K",
       "l": "GitHub stars"
      },
      {
       "n": "230",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Babel (JavaScript) is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Babel (JavaScript) is a dependency in 230 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (4.7% of the 4,867 JavaScript/TypeScript ones), #4 of 185 in build tools and bundlers.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 749; those are left out of every share on this page.",
      "The most used alternative in our scan is esbuild (310 projects).",
      "Projects that use it most often also use Jest (43.9%), React (73.5%), ESLint (71.7%).",
      "It is more common in projects set up for OpenCode (5.5%) than for OpenClaw (2.4%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "112 projects, 4.6%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "108 projects, 3.3%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "98 projects, 3.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "22 projects, 4.7%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "19 projects, 5.5%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "12 projects, 2.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "11 projects, 3.9%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "8 projects, 2.4%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 43.9% of its projects",
       "v": "Jest",
       "path": "tools/jest/"
      },
      {
       "l": "In 73.5% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 71.7% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 34.3% of its projects",
       "v": "React Native",
       "path": "tools/react-native/"
      },
      {
       "l": "In 36.5% of its projects",
       "v": "Testing Library",
       "path": "tools/testing-library/"
      },
      {
       "l": "In 83.0% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 30.9% of its projects",
       "v": "Expo",
       "path": "tools/expo/"
      },
      {
       "l": "In 30.9% of its projects",
       "v": "react-native-safe-area-context",
       "path": "tools/react-native-safe-area-context/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Babel (JavaScript) in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "New syntax in, supported syntax out",
       "v": "You write current JavaScript and Babel rewrites the features your targets lack into code they can run. The README shows ES2020 nullish coalescing turned into a plain <code>!= null</code> check."
      },
      {
       "l": "Babel can compile TypeScript while tsc only type-checks",
       "v": "With <code>@babel/preset-typescript</code>, Artsy let Babel produce the JavaScript and kept <code>tsc</code> only for type-checking. Their summary of the result: \"Proper type-checking, but compilation handled by Babel\"."
      },
      {
       "l": "One scope for every package",
       "v": "Since Babel 7, the core, presets and plugins all live in one monorepo and are published as <code>@babel/*</code> packages, such as <code>@babel/core</code> and <code>@babel/preset-react</code>."
      },
      {
       "l": "Fixes still land in the 8.x line",
       "v": "The v8.0.7 release fixes bugs across the parser, traverse, helpers and several transform plugins. It also welcomes four first-time contributors."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Config takes ongoing work",
       "v": "Artsy's engineers warn that Babel setups take time to build and maintain. They also say some options can make interop with other environments hard."
      },
      {
       "l": "Some TypeScript features are out of reach",
       "v": "Artsy quotes the TypeScript plugin's README: namespaces and const enums are not supported because they need type information. <code>export =</code> and <code>import =</code> are not supported either. The post dates from the Babel 7 beta."
      },
      {
       "l": "TypeScript and Flow plugins cannot be loaded together",
       "v": "This causes trouble when a dependency or preset turns on the Flow plugin. Artsy says the only fix is to drop that preset or patch the code that loads the plugin."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Nullish coalescing, before and after Babel"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Js",
       "code": "// ES2020 nullish coalescing\nfunction greet(input) {\n  return input ?? \"Hello world\";\n}\n\nfunction greet(input) {\n  return input != null ? input : \"Hello world\";\n}"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Babel (JavaScript)",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/babel",
        "Open Collective: https://opencollective.com/babel",
        "38 GitHub sponsors"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Babel (JavaScript) vs SWC",
         "note": "used together in 31 projects",
         "path": "tools/compare/babel-javascript-vs-swc/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "@babel/preset-env: Picks transforms for your targets",
        "@babel/preset-react: JSX and React preset",
        "@babel/preset-typescript: Compiles TypeScript",
        "@babel/runtime: Shared runtime helpers",
        "@babel/eslint-parser: Lets ESLint read Babel syntax",
        "@babel/parser: Babel's JavaScript parser"
       ]
      },
      {
       "title": "More in Build tools and bundlers",
       "path": "tools/build-tools/",
       "items": [
        {
         "text": "Vite",
         "path": "tools/vite/"
        },
        {
         "text": "Turborepo",
         "path": "tools/turbo/"
        },
        {
         "text": "Laravel Vite Plugin",
         "path": "tools/laravel-vite-plugin/"
        },
        {
         "text": "React Compiler Babel Plugin",
         "path": "tools/babel-plugin-react-compiler/"
        },
        {
         "text": "Nx",
         "path": "tools/nx/"
        },
        {
         "text": "vite-tsconfig-paths",
         "path": "tools/vite-tsconfig-paths/"
        },
        {
         "text": "Nx JS Plugin",
         "path": "tools/nx-js/"
        },
        {
         "text": "packaging",
         "path": "tools/packaging/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Babel (JavaScript)",
       "me": true,
       "facts": [
        "MIT",
        "Gid 84",
        "271M/wk"
       ]
      },
      {
       "name": "esbuild",
       "why": "Pick esbuild when you mostly need fast bundling and shrinking and do not need Babel's plugin system.",
       "path": "tools/esbuild/",
       "facts": [
        "MIT",
        "Gid 85",
        "443M/wk"
       ]
      },
      {
       "name": "SWC",
       "why": "Pick SWC for a much faster compiler written in Rust that covers the common TypeScript and JSX cases.",
       "path": "tools/swc-core/",
       "facts": [
        "Apache-2.0",
        "Gid 78",
        "61.9M/wk"
       ]
      },
      {
       "name": "Vite",
       "why": "Pick Vite for a whole dev server and build setup where you rarely touch the compiler yourself.",
       "path": "tools/vite/",
       "facts": []
      },
      {
       "name": "webpack",
       "why": "Module bundler that packages JavaScript, assets and dependencies for browser deployment.",
       "path": "tools/webpack/",
       "facts": [
        "MIT",
        "Gid 83",
        "76.9M/wk"
       ]
      }
     ],
     "more": "Compare Babel (JavaScript) with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Set up Babel 8 (@babel/core 8.1.0 with @babel/preset-env, @babel/preset-react with runtime automatic and @babel/preset-typescript, Node.js 22.18+) with a top-level targets option, and keep tsc --noEmit for type checking."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install the core, the command-line tool and the main preset as development packages.",
       "code": "npm install --save-dev @babel/core @babel/cli @babel/preset-env",
       "src": "https://babeljs.io/docs/usage"
      },
      {
       "text": "Say which browsers you support. Without it, Babel 8 uses the browserslist \"defaults\" list (Babel 7 compiled for all browsers).",
       "code": "{ \"targets\": \"defaults\", \"presets\": [\"@babel/preset-env\"] }\n",
       "src": "https://babeljs.io/docs/v8-migration"
      },
      {
       "text": "Compile the src folder into lib.",
       "code": "./node_modules/.bin/babel src --out-dir lib",
       "src": "https://babeljs.io/docs/usage"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Babel\n- Install the scoped packages (`@babel/core`, `@babel/preset-env`, `@babel/preset-react`, `@babel/preset-typescript`), not the old unscoped `babel-core` / `babel-preset-*` names.\n- If a preset that is installed reports `Could not find preset`, run `yarn list babel-core` to look for an old Babel 6 copy pulled in by another tool, and pin it with a `resolutions` entry.\n- When Babel compiles TypeScript, run `tsc` only for type-checking, with `\"noEmit\": true`; add `\"skipLibCheck\": true` if it reports errors inside `node_modules`.\n- Do not write TypeScript `namespace`s, `const enum`s, `export =` or `import =` in code compiled by the Babel TypeScript plugin.\n- Never enable the TypeScript and Flow plugins in the same config; remove any preset that turns on Flow, or depend on its individual plugins.\n- With `babel-node`, pass `--extensions '.ts,.tsx'` and start from a `.ts` entry file; add `.ts`/`.tsx` to `babel-plugin-module-resolver`'s `extensions` option too.\n- Check what a transform produces in the Babel REPL before changing presets or targets.\n"
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "babel.transform(code, options) used synchronously with @babel/core 8",
       "fix": "babel.transformSync(code, options) or await babel.transformAsync(code, options)",
       "why": "In Babel 8 transform needs a callback; the synchronous fallback was removed."
      },
      {
       "dont": "\"@babel/plugin-proposal-class-properties\" (and other -proposal- plugins) in a Babel 8 config",
       "fix": "Use the -transform- name, e.g. @babel/plugin-transform-class-properties, or drop it since preset-env includes it",
       "why": "These plugins were renamed when the features became standard; the old package is deprecated on npm."
      },
      {
       "dont": "Copying useBuiltIns: \"usage\" and corejs into @babel/preset-env options in Babel 8",
       "fix": "Remove both and add babel-plugin-polyfill-corejs3 for polyfills",
       "why": "Babel 8 removed these options; some guide pages still show them in Babel 7 style."
      },
      {
       "dont": "Leaving out targets after upgrading and expecting the same output as Babel 7",
       "fix": "Set a top-level \"targets\" (or a .browserslistrc file) to the browsers you really support",
       "why": "Babel 7 compiled for every browser by default; Babel 8 compiles for browserslist defaults, so old browsers can break."
      },
      {
       "dont": "Relying on the React preset's old \"classic\" default (React.createElement) after the upgrade",
       "fix": "Set runtime explicitly: \"automatic\" for React 17+, or \"classic\" with useSpread: true if you keep it",
       "why": "The default JSX runtime changed from classic to automatic in Babel 8."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does Babel check my TypeScript types?",
       "a": "No. It only removes them; run the TypeScript checker separately.",
       "evidence": {
        "url": "https://babeljs.io/docs/",
        "quote": "you'll still have to install and use Flow or TypeScript to check types."
       }
      },
      {
       "q": "Which browsers does Babel 8 compile for by default?",
       "a": "The browserslist \"defaults\" list, which covers most modern browsers. Babel 7 compiled for all browsers by default.",
       "evidence": {
        "url": "https://babeljs.io/docs/v8-migration",
        "quote": "Use browserslist's defaults as default compilation target"
       }
      },
      {
       "q": "Can I use Babel in the browser?",
       "a": "Yes, with @babel/standalone, mainly for playgrounds and prototypes; config files do not work there.",
       "evidence": {
        "url": "https://babeljs.io/docs/babel-standalone",
        "quote": "Note that config files don't work in @babel/standalone , as no file system access is available."
       }
      },
      {
       "q": "Can I write my own code changes with it?",
       "a": "Yes. Babel is built from plugins, and you can write your own to change code in any way.",
       "evidence": {
        "url": "https://babeljs.io/docs/",
        "quote": "Compose your own transformation pipeline using existing plugins or write your own."
       }
      },
      {
       "q": "Can I use it in a paid product?",
       "a": "Yes. Babel is MIT licensed; keep the notice with copies of its code.",
       "evidence": {
        "url": "https://github.com/babel/babel/blob/main/LICENSE",
        "quote": "MIT License"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm @babel/core"
  ],
  [
   "Category",
   "Build tools and bundlers"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v8.0.7, October 7, 2026"
  ],
  [
   "On GitHub since",
   "September 2014"
  ],
  [
   "Gid Score",
   "84.1"
  ],
  [
   "Rank in category",
   "#4 of 185"
  ],
  [
   "GitHub",
   "babel/babel"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [
  "Babel 8 came out in June 2026 and needs Node.js 22.18 or 24.11 and newer. It is published only as modern modules.",
  "It does not check TypeScript types. A wrong type passes straight through, so keep the TypeScript checker in your tests.",
  "Mixing Babel 7 and Babel 8 packages is not supported; upgrade the core, presets and plugins together."
 ],
 "checked_line": "Read by AgentGid from 20 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/babel.png"
}