async2trycatch
v1.0.1
Published
自动包裹await
Readme
async2trycatch
Install
yarn add async2trycatch -DUsage
// webpack.config.js
module: {
rules: [
{
test: /\.js$/,
use:{
loader:'async2trycatch',
options:{
}
}
}
]
}Options
| Name | Type | Default | Description |
| ----------------- | ---------- | -------------------- | ------------------------------ |
| identifier | {string} | "e" | catch 子句中的错误对象标识符 |
| catchCode | {string} | "console.error(e)" | catch 子句中的代码片段 |
| finallyCode | {string} | undefined | finally 子句中的代码片段 |
