Skip to content

Commit 35a36cd

Browse files
committed
docs(kkrpc): add video tutorial section to readme
1 parent 3e1faa2 commit 35a36cd

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/npm-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
environment: publish
1818
permissions:
19-
contents: read
19+
contents: write
2020
id-token: write
2121
steps:
2222
- uses: actions/checkout@v4
@@ -27,6 +27,7 @@ jobs:
2727
- uses: actions/setup-node@v4
2828
with:
2929
node-version: 22
30+
registry-url: https://registry.npmjs.org
3031
- uses: pnpm/action-setup@v4
3132
- run: |
3233
pnpm install
@@ -42,3 +43,5 @@ jobs:
4243
if: steps.check_version.outcome != 'success'
4344
working-directory: ./packages/kkrpc
4445
run: npm publish --provenance --access public
46+
env:
47+
NPM_CONFIG_PROVENANCE: true

packages/kkrpc/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ Call remote functions as if they were local, with full TypeScript type safety an
2929

3030
[**Quick Start**](#-quick-start)[**Documentation**](https://kunkunsh.github.io/kkrpc/)[**Examples**](#-examples)[**API Reference**](https://jsr.io/@kunkun/kkrpc/doc)[**LLM Docs**](https://docs.kkrpc.kunkun.sh/llms.txt)[**中文文档**](./README.zh.md)
3131

32+
## 🎥 Video Tutorial
33+
34+
[![kkrpc Tutorial](https://img.youtube.com/vi/CF8lji8eB30/0.jpg)](https://youtu.be/CF8lji8eB30)
35+
36+
Watch this video for a comprehensive introduction to kkrpc and how to use it in your projects.
37+
3238
## 🤖 AI Support
3339

3440
Working with kkrpc in your AI-powered editor? Add these skills to your Claude Code configuration to get intelligent assistance:
@@ -80,7 +86,7 @@ kkrpc stands out in the crowded RPC landscape by offering **true cross-runtime c
8086
| **⚡ Zero Config** | No schema files or code generation required |
8187
| **🔒 Data Validation** | Optional runtime validation with Zod, Valibot, ArkType, etc. |
8288
| **🔌 Middleware** | Interceptor chain for logging, auth, timing, and more |
83-
| **⏱️ Request Timeout** | Auto-reject pending calls after a configurable deadline |
89+
| **⏱️ Request Timeout** | Auto-reject pending calls after a configurable deadline |
8490
| **🔁 Streaming** | Return `AsyncIterable` from methods, consume with `for await` |
8591
| **🚀 Transferable Objects** | Zero-copy transfers for large data (40-100x faster) |
8692

@@ -302,7 +308,7 @@ Interceptors run **after** input validation and **before** output validation, so
302308
kkrpc supports optional request timeouts to prevent pending calls from hanging forever if the remote side crashes or the transport drops:
303309

304310
```ts
305-
import { RPCChannel, isRPCTimeoutError } from "kkrpc"
311+
import { isRPCTimeoutError, RPCChannel } from "kkrpc"
306312

307313
const rpc = new RPCChannel(io, {
308314
expose: api,
@@ -313,7 +319,7 @@ try {
313319
await api.slowOperation()
314320
} catch (error) {
315321
if (isRPCTimeoutError(error)) {
316-
console.log(error.method) // "slowOperation"
322+
console.log(error.method) // "slowOperation"
317323
console.log(error.timeoutMs) // 5000
318324
}
319325
}
@@ -1604,7 +1610,6 @@ bun test
16041610
The benchmarks are designed to measure two key aspects of RPC performance:
16051611
16061612
1. **Call Throughput** (`stdio-benchmark.test.ts`, `websocket-benchmark.test.ts`)
1607-
16081613
- **Sequential Operations**: Measures latency per call when making blocking calls one after another
16091614
- **Concurrent Operations**: Measures throughput when making many calls in parallel using `Promise.all`
16101615
- **Batch Operations**: Tests batching multiple operations into a single RPC call
@@ -1684,7 +1689,7 @@ Results from running on a MacBook Pro (Apple Silicon):
16841689
| **Zero Config** | ✅ No code generation | ✅ No code generation | ✅ No code generation |
16851690
| **Callbacks** | ✅ Function parameters | ❌ No callbacks | ✅ Function parameters |
16861691
| **Data Validation** | ✅ Optional, any Standard Schema library | ✅ Built-in Zod support | ❌ Not supported |
1687-
| **Middleware** | ✅ Interceptor chain (onion model) |`.use()` middleware | ❌ Not supported |
1692+
| **Middleware** | ✅ Interceptor chain (onion model) |`.use()` middleware | ❌ Not supported |
16881693
| **Request Timeout** | ✅ Per-channel timeout + destroy cleanup | ❌ Not built-in | ❌ Not supported |
16891694
| **Streaming** | ✅ AsyncIterable with cancel + error propagation | ✅ SSE subscriptions | ❌ Not supported |
16901695
| **Transferable Objects** | ✅ Zero-copy transfers (40-100x faster) | ❌ Not supported | ✅ Basic support |

0 commit comments

Comments
 (0)