it-pb-stream - v4.0.2

This module makes it easy to send and receive Protobuf encoded messages over streams.

Example

import { pbStream } from 'it-pb-stream'
import { MessageType } from './src/my-message-type.js'

// RequestType and ResponseType have been generate from `.proto` files and have
// `.encode` and `.decode` methods for serialization/deserialization

const stream = pbStream(duplex)
stream.writePB({
foo: 'bar'
}, MessageType)
const res = await stream.readPB(MessageType)

Index

Interfaces

Functions