@lowerdeck/rpc-client 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/.turbo/turbo-build.log +15 -9
- package/CHANGELOG.md +7 -0
- package/README.md +47 -0
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
[0m[2m[35m$[0m [2m[1mmicrobundle[0m
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
No name was provided for external module '@lowerdeck/canonicalize' in output.globals – guessing 'canonicalize'
|
|
4
|
+
No name was provided for external module '@lowerdeck/error' in output.globals – guessing 'error'
|
|
5
|
+
No name was provided for external module '@lowerdeck/serialize' in output.globals – guessing 'serialize'
|
|
6
|
+
No name was provided for external module '@lowerdeck/id' in output.globals – guessing 'id'
|
|
7
|
+
No name was provided for external module '@lowerdeck/memo' in output.globals – guessing 'memo'
|
|
8
|
+
No name was provided for external module '@lowerdeck/proxy' in output.globals – guessing 'proxy'
|
|
9
|
+
[34mBuild "@lowerdeck/rpc-client" to dist:[39m
|
|
10
|
+
[32m2.4 kB[39m: [37mindex.cjs[39m.gz
|
|
11
|
+
[32m2.16 kB[39m: [37mindex.cjs[39m.br
|
|
12
|
+
[32m1383 B[39m: [37mindex.module.js[39m.gz
|
|
13
|
+
[32m1212 B[39m: [37mindex.module.js[39m.br
|
|
14
|
+
[32m2.39 kB[39m: [37mindex.module.js[39m.gz
|
|
15
|
+
[32m2.16 kB[39m: [37mindex.module.js[39m.br
|
|
16
|
+
[32m2.5 kB[39m: [37mindex.umd.js[39m.gz
|
|
17
|
+
[32m2.27 kB[39m: [37mindex.umd.js[39m.br
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# `@lowerdeck/rpc-client`
|
|
2
|
+
|
|
3
|
+
Type-safe RPC client for making remote procedure calls. Provides automatic serialization, error handling, and request memoization.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lowerdeck/rpc-client
|
|
9
|
+
yarn add @lowerdeck/rpc-client
|
|
10
|
+
bun add @lowerdeck/rpc-client
|
|
11
|
+
pnpm add @lowerdeck/rpc-client
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { createClient } from '@lowerdeck/rpc-client';
|
|
18
|
+
|
|
19
|
+
// Define your API interface
|
|
20
|
+
interface API {
|
|
21
|
+
getUser(id: string): Promise<{ name: string; email: string }>;
|
|
22
|
+
createPost(data: { title: string; content: string }): Promise<{ id: string }>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Create a type-safe client
|
|
26
|
+
const client = createClient<API>({
|
|
27
|
+
url: 'https://api.example.com/rpc'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Make RPC calls with full type safety
|
|
31
|
+
const user = await client.getUser('user_123');
|
|
32
|
+
console.log(user.name);
|
|
33
|
+
|
|
34
|
+
const post = await client.createPost({
|
|
35
|
+
title: 'Hello World',
|
|
36
|
+
content: 'This is my first post'
|
|
37
|
+
});
|
|
38
|
+
console.log(post.id);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
This project is licensed under the Apache License 2.0.
|
|
44
|
+
|
|
45
|
+
<div align="center">
|
|
46
|
+
<sub>Built with ❤️ by <a href="https://metorial.com">Metorial</a></sub>
|
|
47
|
+
</div>
|