- Notifications
You must be signed in to change notification settings - Fork18
A collection of sweet.js macros that implement ES6 features for ES5
License
NotificationsYou must be signed in to change notification settings
jlongster/es6-macros
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a collection ofsweet.js macros thatimplement syntactic ES6 features that can be easily compiled out toES5 JavaScript, which can be used today everywhere.
Warning: This is still in development and most of these features are not completely compliant with ES6 yet. I wouldn't recommend using it for production code yet.
Currently implemented:
- destructuring (including elision and rest)
- classes
- fat arrow functions
TODO:
- rest and default arguments
- spread operator for applying arguments
- possibly limited
for of
support - possibly limited module support
$ npm install sweet.js es6-macros
Write your improved ES6 JavaScript, and compile it:
$ sjs -m es6-macros file.js
If you pass-c
to sjs along with-o output.js
, it will generate asourcemap so you get good debugging too!
To run the tests:
npm installmake