Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jlongster/es6-macros
A collection of sweet.js macros that implement ES6 features for ES5
https://github.com/jlongster/es6-macros
Last synced: 4 days ago
JSON representation
A collection of sweet.js macros that implement ES6 features for ES5
- Host: GitHub
- URL: https://github.com/jlongster/es6-macros
- Owner: jlongster
- License: bsd-2-clause
- Created: 2013-11-24T18:02:26.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-04T15:45:38.000Z (over 10 years ago)
- Last Synced: 2025-01-01T04:11:35.277Z (11 days ago)
- Language: JavaScript
- Size: 649 KB
- Stars: 237
- Watchers: 17
- Forks: 18
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- es6-tools - Some Sweet.js macros
README
# es6-macros
This is a collection of [sweet.js](http://sweetjs.org/) macros that
implement syntactic ES6 features that can be easily compiled out to
ES5 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 functionsTODO:
* rest and default arguments
* spread operator for applying arguments
* possibly limited `for of` support
* possibly limited module support## Using
```
$ 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 a
sourcemap so you get good debugging too!## Contributing
To run the tests:
```bash
npm install
make
```