There is an option to use babel API to transform javascript code from ecma script 5 to ecma script 6? I mean lets say I use the following cdn
https://cdnjs.cloudflare.com/ajax/libs/babel-core/6.1.19/browser.js
and provide a source like array or object with simple code of ES5 and it transform it to some array/object/string of ES6 code?
is it possible somehow to achieve this with babel or some other tool?
I mean to use some example from here for instance.. https://github.com/addyosmani/es6-equivalents-in-es5
if I put in source ES5 Code
[1, 2, 3].map(function(n) { return n * 2; }, this);
It converted to arrow function in ES6
[1, 2, 3].map(n => n * 2);
UPDATE
What I need is actually is to take ES5 code and change it to ES6 code, it can be via api
For example is I need API/open source that do something like this (my code is in the left side )