node package manager

browserify-es6-transpiler

Browserify ES6 Transpiler

Adds a wrapper around the jstransform and es6-module-jstransform npm packages to transpile ES6 module syntax to CommonJS and ES6 features down to ES5.1

Installation

npm install browserify-es6-transpiler --save-dev

Usage

var browserify = require('browserify');
var browserifyES6Transpiler = require('browserify-es6-transpiler');
 
browserify()
    .require('./src/index.js')
    .transform(browserifyES6Transpiler)
    .bundle()
    ...

Alternatively, to use the transpiler without browserify:

var transpile = require('browserify-es6-transpiler/transpile');
var content = transpile(source);
 
...