Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mping/5to6

Converts es5 to es6, using simple and safe transforms
https://github.com/mping/5to6

Last synced: about 2 months ago
JSON representation

Converts es5 to es6, using simple and safe transforms

Awesome Lists containing this project

README

        

# 5to6

Convert your es5 code to es6, using basic transforms.
Right now what happens is that simple anonymous functions are converted to arrow syntax.

```
function(a,b,c) {
a = b + c;
return a + 2;
}
```

gets converted to
```
(a,b,c) => {a = b + c; return a + 2;}
```

## Using

Just call ```node index.js ``` to transpile to sysout
```
> node index.js test.js
```

alternatively, write directly to same infile

```
> cat test.js | node index.js | tee test.js

```

## TODO
- [ ] allow flexible configuration
- [ ] add more visitors
- [x] parens free arrows
- [ ] const
- [ ] let
- [ ] default argument values
- ...