TypeScript AutoawaitThis VScode extension automatically add missing 'async/await' keywords when you save a typescript file. AlertThis plugin is not intended for beginners. It’s simply a helper to reduce some repetitive work. You should have a solid understanding of how asynchronous behavior works in JavaScript before considering using it. WhyWhen I develop backend applications, almost all of the logic is synchronous. Having to type "async/await" over and over again felt like a meaningless chore. Sometimes, when I forgot to add "await" somewhere and had to go back to fix it, it even annoyed me. But now, things are more comfortable. UsageInstall the extension in VScode. There must be a "tsconfig.json" in your project folder. Exampleadd "await" and/or "async"1
2
3
the above 3 scripts will be converted to
no autoawaitIf you do not want some async function to be added "await", use "//async" comment at the end of the call:
PerformanceThe first converting is slow. Then it will be fast. |