This module makes it easy to send and receive Protobuf encoded messages over streams.
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/deserializationconst stream = pbStream(duplex)stream.writePB({ foo: 'bar'}, MessageType)const res = await stream.readPB(MessageType)
This module makes it easy to send and receive Protobuf encoded messages over streams.
Example