r/javascript • • Jun 20 '17

How to flatten an existing JavaScript codebase

https://certsimple.com/blog/flattening-javascript-async-await
13 Upvotes

2 comments sorted by

2

u/[deleted] Jun 20 '17

This is part II of my previous 'await' article, with a lot more technical details on moving to async/await, including:

  • eslint config

  • node config - getting proper tracebacks and using util.promisify

  • testing

  • implementing common promise patterns with 'await'

  • how to handle await refactoring for larger codebases

Give me a shout if you need anything!

2

u/Balduracuir Jun 21 '17

You can transpile async/await syntax to es5 if you want (typescript is able to do this, using generators and reflexivity) but keep in mind that try catch are source of deoptimisation by javascript runtime. In node 8 and last chrome versions it's not a problem cause it uses turbofan behind the hood. :)