Skip to content

Client

Defined in: procwire-bun-client/src/client.ts:57

Client - Child-side API for Procwire IPC.

This is the Bun.js version; the API is identical to @procwire/client.

const client = new Client()
.handle('query', async (data, ctx) => {
const results = await search(data);
ctx.respond(results);
})
.handle('insert', async (data, ctx) => {
ctx.ack({ accepted: true });
await processInBackground(data);
})
.event('progress');
await client.start();
// Emit events to parent
client.emitEvent('progress', { percent: 50 });

S extends SpawnError = SpawnError

new Client<S>(): Client<S>

Client<S>

ClientCore<S>.constructor