@herrlich-digital/trycatch-wrapper 1.0.4 → 1.0.10
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 +13 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,24 +6,29 @@
|
|
|
6
6
|
|
|
7
7
|
TryCatch-Wrapper is a lightweight utility designed to simplify error handling in TypeScript applications. It provides a structured approach to handling asynchronous errors using a `Result` type pattern, ensuring better code maintainability and readability.
|
|
8
8
|
|
|
9
|
+
## Available on
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@herrlich-digital/trycatch-wrapper)
|
|
12
|
+
[](https://github.com/orgs/Herrlich-Digital/packages)
|
|
13
|
+
|
|
9
14
|
## Installation
|
|
10
15
|
|
|
11
|
-
You can install the package
|
|
16
|
+
You can install the package using bun:
|
|
12
17
|
|
|
13
18
|
```sh
|
|
14
|
-
bun add @
|
|
19
|
+
bun add @herrlich-digital/trycatch-wrapper
|
|
15
20
|
```
|
|
16
21
|
|
|
17
22
|
or using npm:
|
|
18
23
|
|
|
19
24
|
```sh
|
|
20
|
-
npm install @
|
|
25
|
+
npm install @herrlich-digital/trycatch-wrapper
|
|
21
26
|
```
|
|
22
27
|
|
|
23
28
|
or using yarn:
|
|
24
29
|
|
|
25
30
|
```sh
|
|
26
|
-
yarn add @
|
|
31
|
+
yarn add @herrlich-digital/trycatch-wrapper
|
|
27
32
|
```
|
|
28
33
|
|
|
29
34
|
## Usage
|
|
@@ -60,7 +65,7 @@ export async function tryCatch<T, E = Error>(
|
|
|
60
65
|
### Basic Example
|
|
61
66
|
|
|
62
67
|
```ts
|
|
63
|
-
import { tryCatch } from "@
|
|
68
|
+
import { tryCatch } from "@herrlich-digital/trycatch-wrapper";
|
|
64
69
|
|
|
65
70
|
async function fetchData(): Promise<string> {
|
|
66
71
|
return await fetch("https://api.example.com/data").then((res) => res.json());
|
|
@@ -110,5 +115,6 @@ Developed by Christoph Planken.
|
|
|
110
115
|
|
|
111
116
|
## Links
|
|
112
117
|
|
|
113
|
-
- [GitHub Repository](https://github.com/
|
|
114
|
-
- [GitHub Packages](https://github.com/
|
|
118
|
+
- [GitHub Repository](https://github.com/Herrlich-Digital/tryCatch-Wrapper)
|
|
119
|
+
- [GitHub Packages](https://github.com/orgs/Herrlich-Digital/packages)
|
|
120
|
+
- [npmjs.org](https://www.npmjs.com/package/@herrlich-digital/trycatch-wrapper)
|
package/package.json
CHANGED