@liha-labs/apizel 0.1.0
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/LICENSE +5 -0
- package/README.md +39 -0
- package/package.json +37 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# apizel
|
|
2
|
+
|
|
3
|
+
**Thin fetch wrapper for TypeScript.**
|
|
4
|
+
標準の `fetch` に、ちょうどいい薄皮。
|
|
5
|
+
|
|
6
|
+
- TanStack Query friendly (`signal` respected, `timeoutMs` uses Abort)
|
|
7
|
+
- Minimal axios-like body handling (FormData passthrough, JSON Content-Type fallback)
|
|
8
|
+
- 401 refresh retry (single-flight, retry once)
|
|
9
|
+
- Observe-only hooks (`onRequest` / `onResponse`)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @liha-labs/apizel
|
|
15
|
+
# npm i @liha-labs/apizel
|
|
16
|
+
# yarn add @liha-labs/apizel
|
|
17
|
+
````
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { apizel } from '@liha-labs/apizel'
|
|
23
|
+
|
|
24
|
+
type Me = { id: string; name: string }
|
|
25
|
+
|
|
26
|
+
const api = apizel({ baseURL: 'https://api.example.com' })
|
|
27
|
+
|
|
28
|
+
const me = await api.get<Me>('/v1/me')
|
|
29
|
+
console.log(me)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Docs
|
|
33
|
+
|
|
34
|
+
* Documentation:
|
|
35
|
+
* Repository: https://github.com/liha-labs/apizel
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT © 2026 Liha Labs
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liha-labs/apizel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lightweight fetch-based API client for Web + React Native.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"dev": "tsup --watch",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"tsup": "^8.2.0",
|
|
34
|
+
"typescript": "^5.6.0",
|
|
35
|
+
"vitest": "^2.1.0"
|
|
36
|
+
}
|
|
37
|
+
}
|