0.1.0 • Published 7 years ago
lambdalebab v0.1.0
λ-Lebab
Forked from Lebab
Lebab transpiles your ES5 code to ES6/ES7. It does exactly the opposite of what Babel does. If you want to understand what Lebab exactly does, try the live demo.
λ-Lebab Transfroms your every functions, to Lambda Expressions in a better way.
Before
var hello = function hello() {
return 'hello';
};
After
var hello = () => 'hello';
API
Simply import and call lambdalebab.transform()
:
import lambdalebab from 'lambdalebab';
const {code, warnings} = lambdalebab.transform('var f = function f(){};', ['let', 'arrow']);
console.log(code); // -> "const f = () => {};"
The warnings will be an array of objects like:
[
{line: 12, msg: 'Unable to transform var', type: 'let'},
{line: 45, msg: 'Can not use arguments in arrow function', type: 'arrow'},
]
0.1.0
7 years ago