Lebab modernizes your JavaScript code!

Get started!
var Employee = function Employee() {
  this.alive = true;
};

Employee.prototype.setSkills = function(skills) {
  skills = skills || [];
  var defaultSkills = ['JavaScript'];
  this.skills = skills.concat(defaultSkills);
};

Employee.prototype.sayHello = function() {
  window.setTimeout(function() {
    console.log('Hello World!');
  }, 2000);
};

Object.defineProperty(Employee.prototype, 'name', {
  get: function() {
    return this.firstName + ' ' + this.lastName;
  }
});

Still coding like this?

This code is fine. There's nothing wrong with it. It's clean and understandable. But it's just a little old :/

Wait... Think twice!

This is the ES2015 version of this code. It is syntactical sugar, isn't it?
Learn more about ES2015

class Employee {
  constructor() {
    this.alive = true;
  }

  setSkills(skills=[]) {
    const defaultSkills = ['JavaScript'];
    this.skills = skills.concat(defaultSkills);
  }

  sayHello() {
    window.setTimeout(() => {
      console.log('Hello World!');
    }, 2000);
  }

  get name() {
    return `${this.firstName} ${this.lastName}`;
  }
}

Getting started

Lebab helps you modernize your old-fashioned code. It scans your code and finds the parts that can be converted to a newer version of ECMAScript.

You can install Lebab CLI tool via npm:

npm install -g lebab

Then run this command to convert your es5 code into es6:

lebab es5.js -o es6.js

You can also check the REPL.