Skip to content

Instantly share code, notes, and snippets.

@mrister
Last active June 8, 2016 08:21
Show Gist options
  • Save mrister/657ed52e1bd836a9c13cbb6df4f008e6 to your computer and use it in GitHub Desktop.
Save mrister/657ed52e1bd836a9c13cbb6df4f008e6 to your computer and use it in GitHub Desktop.
Babel example
#!/usr/bin/env bash
# install babel cli and preset
npm install --save-dev babel-cli babel-preset-es2015
# do the transpiling of original.js file to transpiled.js
babel original.js --out-file=transpiled.js
// small example
let tests= ['one', '2', 'III'];
const test = () => console.log(...tests);
test();
'use strict';
var tests = ['one', '2', 'III'];
var test = function test() {
var _console;
return (_console = console).log.apply(_console, tests);
};
test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment