Current collected state Current
Observed since 20 Oct, 18:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
123peterkim-minirpc
Server:
Server:
import { createServer } from 'minirpc'
const server = createServer()
const router = server.router({
greet(name: string) {
return `Hello ${name}`
},
})
export type Router = typeof router
await server.serve({ port: 3000 })
Client:
import createClient from 'minirpc'
import type { Router } from './server'
const api = createClient<Router>({
url: 'ws://localhost:3000',
})
console.log(await api.greet('World')) // Hello World
Server:
import { createChannel } from 'minirpc'
const channel = createChannel((name: string) => {
return `Welcome ${name} to this channel`
})
setInterval(() => {
channel.push(`This channel has ${channel.size} subscribers`)
}, 1000)
router({
getEvents: channel.pull,
})
Client:
api.getEvents('John Doe').subscribe((event) => {
// Welcome John Doe to this channel
// This channel has 1 subscribers
console.log(event)
})
import { createContext, RPCClientError } from 'minirpc'
const userIdContext = createContext<string>()
router({
logIn(username: string, password: string) {
const userId = userIdContext()
if (username === 'Admin' && password === '123456') {
userId.set('admin')
} else {
throw new RPCClientError('Wrong credentials')
}
},
getAdminData() {
const userId = userIdContext()
if (userId.get() === 'admin') {
return 'secret'
} else {
throw new RPCClientError('Expected Admin')
}
},
})
Server:
server.serve({
onUpgrade(ctx) {
if (ctx.request.url === '/forbidden') {
ctx.error(401)
return
}
const ws = ctx.upgrade()
console.log('connection open')
ws.on('close', (code, reason) => {
console.log('connection closed')
})
},
})
Client:
const api = createClient<Router>({
url: 'ws://localhost:3000',
backoff: {
jitter: false,
maxDelay: Infinity,
numOfAttempts: 10,
retry: () => true,
startingDelay: 100,
timeMultiple: 2,
},
onConnection((connection) => {
console.log('connection opened')
await connection.closed // wait for connection to close
console.log('connection closed')
})
})
Server:
const server = createServer({
pingTimeout: 60_000,
pongTimeout: 1_000,
})
Client:
const api = createClient({
pingInterval: 30_000,
pongTimeout: 1_000,
})
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
devalueEnvironment{
"local_name": "devalue",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | runtime |
wsEnvironment{
"local_name": "ws",
"alias": false,
"peer_metadata": null
} | ^8.18.0 | runtime |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^22.5.4 | development |
@types/wsEnvironment{
"local_name": "@types/ws",
"alias": false,
"peer_metadata": null
} | ^8.5.12 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^9.10.0 | development |
tsxEnvironment{
"local_name": "tsx",
"alias": false,
"peer_metadata": null
} | ^4.19.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.5.4 | development |
typescript-eslintEnvironment{
"local_name": "typescript-eslint",
"alias": false,
"peer_metadata": null
} | ^8.4.0 | development |
Source distribution
{
"integrity": "sha512-odPAVWHfkQ+M9z+P71raMpw67NX2PHfnd9DkOF1n31KC+hq56f+1vMWa1uoVooIreRFeS2jsNYt4q5wJqSGdwg==",
"shasum": "31b163c6044015ec6b68ca396e37a0ca2d3e2200",
"tarball": "https://registry.npmjs.org/123peterkim-minirpc/-/123peterkim-minirpc-0.0.1.tgz",
"fileCount": 5,
"unpackedSize": 35892,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIH7L/+ZkGeogsqyBwGGG/LvUccKd8De0cIUqhd3q/kH2AiEAya+r2ytPXvXeXSc7lzth/QQgg78dGoDdvAAdbbT6Iv4="
}
]
}Shared repository data · GitHub
Public sponsor counts have not been collected. These signals belong to the repository owner.
github · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-24 | 0 | 2026-10-24T11:54:14.9074778Z |
Observed since 20 Oct, 18:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:bd941f894395e49b52a98c8c574b3bf02d912d7287d65a2afabccc8edc5d1330