Lebab transpiles legacy ES5 JavaScript into ES6 and ES7 syntax via npm. It applies focused transforms such as arrows, classes, let, and template literals.
Overview
Lebab modernizes older JavaScript source by applying named syntactic transforms. You install it with npm and run the CLI against files or directories, enabling one transform at a time or batches of changes.
Safe transforms include arrow functions, for-of loops, object method shorthand, exponent operators, and similar mechanical upgrades. Unsafe transforms cover let and const, classes, CommonJS-to-ES-module conversion, and template strings, where heuristics may not preserve behavior in every edge case.
The project documents limitations per transform and recommends inspecting diffs after each step. A programming API exposes transform() for integration in other tools, returning rewritten code plus warnings.
Editor plugins are listed for running Lebab inside common development environments.
Key features
- Named ES5-to-ES6 transforms
- Directory in-place conversion
- Safe and unsafe transform groups
- Programmatic transform API
- Editor plugin integrations
- Per-transform limitation docs
Use cases
- Upgrading legacy JavaScript codebases
- Teaching ES6 syntax migration
- Mechanical refactors before review
- Batch modernizing callbacks
- Converting CommonJS modules