# it-pb-rpc

> A convenience-wrapper around protocol-buffers and lp-messages functions

Latest version **0.2.0** (published 2022-01-03) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install it-pb-rpc
pnpm add it-pb-rpc
yarn add it-pb-rpc
bun add it-pb-rpc
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-01-03 |
| First published | 2019-11-07 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Maciej Krüger |
| Maintainers | mkg20001 |

## Links

- npm: https://www.npmjs.com/package/it-pb-rpc
- Repository: https://github.com/mkg20001/it-pb-rpc
- Homepage: https://github.com/mkg20001/it-pb-rpc#readme
- Issues: https://github.com/mkg20001/it-pb-rpc/issues
- npm.io page: https://npm.io/package/it-pb-rpc

## Dependencies (2)

- [it-handshake](https://npm.io/package/it-handshake.md) ^2.0.0
- [it-length-prefixed](https://npm.io/package/it-length-prefixed.md) ^5.0.3

## Recent versions

- 0.2.0 (latest) — 2022-01-03
- 0.1.13 — 2022-01-03
- 0.1.12 — 2022-01-02
- 0.1.11 — 2021-04-16
- 0.1.9 — 2020-10-03
- 0.1.8 — 2020-04-03
- 0.1.7 — 2020-03-21
- 0.1.6 — 2020-02-14
- 0.1.5 — 2020-02-08
- 0.1.4 — 2019-11-21
- 0.1.3 — 2019-11-13
- 0.1.2 — 2019-11-07
- 0.1.1 — 2019-11-07
- 0.1.0 — 2019-11-07

## README

# it-pb-rpc

A convinience-wrapper arround protocol-buffers and lp-messages functions

# API

- `wrap(duplex, opts)`: Wraps a duplex, returns below object (opts=Object with encode/decode opts from [it-length-prefixed api](https://www.npmjs.com/package/it-length-prefixed#api))
  - `.read(bytes)`: async, reads the given amount of bytes
  - `.readLP()`: async, reads one length-prefixed message
  - `.readPB(proto)`: async, reads one protocol-buffers length-prefixed message (proto=Object with .encode, .decode functions)
  - `.write(data)`: writes the given data (data=Buffer or BufferList)
  - `.writeLP(data)`: writes the given data with a length-prefixe (data=Buffer or BufferList)
  - `.writePB(data, proto)`: encodes the data, then writes it withg a length-prefix (data=Buffer or BufferList, proto=Object with .encode, .decode functions)
  - `.pb(proto)`: returns a convinience wrapper for writing messages
    - `.read()`: reads one length-prefixed message encoded with `proto`
    - `.write(data)`: writes one length-prefixed message encoded with `proto`

---
_Source: https://npm.io/package/it-pb-rpc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
