@nannygoose-utils/async-handler 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/package.json +8 -7
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @nannygoose-utils/async-handler
|
|
2
|
+
|
|
3
|
+
一个轻量、高效的异步/同步操作错误处理工具,统一结果返回格式,告别重复 `try/catch` 代码,让错误处理更优雅。
|
|
4
|
+
|
|
5
|
+
## 📦 安装
|
|
6
|
+
|
|
7
|
+
使用 npm、yarn 或 pnpm 安装:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npm
|
|
11
|
+
npm install @nannygoose-utils/async-handler --save
|
|
12
|
+
|
|
13
|
+
# yarn
|
|
14
|
+
yarn add @nannygoose-utils/async-handler
|
|
15
|
+
|
|
16
|
+
# pnpm
|
|
17
|
+
pnpm add @nannygoose-utils/async-handler
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@nannygoose-utils/async-handler",
|
|
3
|
-
"version": "1.0.
|
|
2
|
+
"name": "@nannygoose-utils/async-handler",
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "异步/同步错误处理工具,统一返回 [error, result] 格式",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
-
|
|
9
8
|
"files": [
|
|
10
9
|
"dist"
|
|
11
10
|
],
|
|
12
11
|
"scripts": {
|
|
13
|
-
|
|
14
|
-
"prepublishOnly": "npm run build"
|
|
12
|
+
"build": "tsc && node -e \"require('fs').renameSync('dist/index.js', 'dist/index.mjs')\"",
|
|
13
|
+
"prepublishOnly": "npm run build",
|
|
14
|
+
"version:patch": "npm version patch",
|
|
15
|
+
"release": "npm run version:patch && npm publish --access public"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [],
|
|
17
18
|
"author": "<tandongyang@1ceng.com>",
|