babel-plugin-async-function-try-catch
Add try catch code blocks to async functions
Example
In
{ await ;}
Out
{ try await ; catch error {}}
Out with options
Handle uncaught errors with handleError
; { try await ; catch error ; }
Install
npm:
npm install --save-dev babel-plugin-async-function-try-catch
yarn:
yarn add -D babel-plugin-async-function-try-catch
Usage
With a configuration file
Without options:
With options:
With a CLI
babel --plugins babel-plugin-async-function-try-catch script.js
With a Node API
;
Options