ES6 Module Transpiler

Tomorrow’s JavaScript module syntax today

ES6 Module Transpiler is a JavaScript library for converting JavaScript files written using the ES6 draft specification module syntax to existing library-based module systems such as AMD, CommonJS, or simply globals.

Demo

input/segment.js output/segment.js
Transpile to


Things to try

import "jquery" as jQuery;          // Import module as a variable
import Point from "math";           // Import one part of a module
import { sqrt, Point } from "math"; // Import multiple parts of a module
export = jQuery;                    // Export an object as the module
export Point;                       // Export an object as a module property
export { sqrt, Point };             // Export multiple objects as module properties
Fork me on GitHub