Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
aeosynth
· 11y ago · 0 comments
You can also use a transpiler such as 6to5[0] which supports ES7 async/await.
[0]:
http://6to5.org/
Comments
[–]
drapper
11y ago
...and you can also have something like that using Bluebird.coroutine() (
https://github.com/petkaantonov/bluebird/blob/master/API.md#...
) or co (
https://github.com/tj/co
, see also
https://github.com/koajs/koa
)
[–]
phpnode
11y ago
6to5 actually supports compiling async/await to bluebird coroutines
[–]
davedx
11y ago
Whaaa... they're putting experimental ES7 features in a transpiler called 6to5? Or am I missing something?
[–]
phpnode
11y ago
Its getting a new name:
https://github.com/6to5/6to5/issues/596
[–]
aeosynth
OP
11y ago
The project scope has expanded:
https://github.com/6to5/6to5/issues/568
[–]
soaringmonchi
11y ago
Definitely my preferred approach. Note that you need to run 6to5 with the -e flag to try this.
[–]
thejameskyle
11y ago
I think you mean the --experimental flag. -e is for evaluate.
[–]
jonpaul
11y ago
Where does it say that it supports async/await?
[–]
drapper
11y ago
http://6to5.org/docs/usage/transformers/#async-to-generator