Get started with babel-core CDN

MIT licensed

Babel-core: essential JS, JSX transformation and parsing.

Tags:
  • 6to5
  • babel
  • classes
  • const
  • es6
  • harmony
  • let
  • modules
  • transpile
  • transpiler
  • var

Stable version

Copied!

How to start using babel-core CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with babel-core CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/babel-core/6.1.19/browser.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-preset-env/1.7.0/browser.min.js"></script>
</head>
<body>
  <script type="text/babel">
    // Transpile this arrow function using Babel-core and the env preset
    const add = (a, b) => a + b;

    // Transpile and execute the following ES6 code using Babel-core
    const result = @babel('(function() { const x = 1; return x + 1; })()', {
      presets: ['env']
    }).code;
    eval(result);

    console.log(add(2, 3)); // Output: 5
  </script>
</body>
</html>
Copied!
Copied!

All versions