# lap-protocol

> The Low bandwidth Application Protocol simplifies the communication of applications connected by low bandwidth links.

Latest version **1.4.2** (published 2021-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install lap-protocol
pnpm add lap-protocol
yarn add lap-protocol
bun add lap-protocol
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2021-10-12 |
| First published | 2021-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 108.5 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | dolencd |
| Keywords | IoT, Low Bandwidth, Communication Protocol |

## Links

- npm: https://www.npmjs.com/package/lap-protocol
- npm.io page: https://npm.io/package/lap-protocol

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [protobufjs](https://npm.io/package/protobufjs.md) ^6.11.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.4.2 (latest) — 2021-10-12
- 1.4.1 — 2021-10-12
- 1.4.0 — 2021-10-07
- 1.3.4 — 2021-09-30
- 1.3.3 — 2021-09-29
- 1.3.2 — 2021-09-28
- 1.3.1 — 2021-09-17
- 1.3.0 — 2021-09-16
- 1.2.4 — 2021-09-09
- 1.2.3 — 2021-09-08
- 1.2.2 — 2021-09-07
- 1.2.1 — 2021-09-06
- 1.2.0 — 2021-09-06
- 1.1.0 — 2021-09-06
- 1.0.0 — 2021-07-22
- … 5 more at https://npm.io/package/lap-protocol/versions

## README

# Low bandwidth Application Protocol

![Build status](https://github.com/dolencd/protocol/actions/workflows/main.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/dolencd/protocol/badge.svg?branch=main)](https://coveralls.io/github/dolencd/protocol?branch=main)
![Current version](https://img.shields.io/npm/v/lap-protocol)



The Low bandwidth application protocol is designed to allow two applications to communicate via application level calls over potentially unreliable networks with as the smallest number and size of messages possible.

## Usage

    Client
    1. Call createClient
    2. Pass message to server
    6. Forward message from the server to the instance of Protocol obtained in step 1

    Server
    3. Receive message from client
    4. Call createServer
    5. Pass message to client

    Both client and server will now generate efficient opaque messages that need to be delivered to the other side.

### Documentation

Reference documentation is available at https://dolencd.github.io/protocol/.

## Usage notes

- If the underlying protocol does not guarantee delivery, implement retransmission logic for the first message (step 2).

## Architecture

When using the library, a developer should only ever interact with the main Protocol class, but under the hood the functionality is split into 2 standalone sub-classes, each with its own role.

### Top

The top later protocol handles application payloads directly. It provides functions and abstractions that, when used, store the data in a local state. When triggered, the top layer will encode this data into an array of bytes (an opaque message) that underlying communication layers need to deliver to the other instance of the library.

It requires that all messages are delivered correctly and in order.

### Bottom

The (optional) bottom layer is used when the underlying communications protocol does not meet the requirements of the top protocol. It provides guarantees in message delivery and ordering, handling processes like acknowledgements and message retransmission.

By default all protocol messages are bundled with application payloads, bringing maximum efficiency. There are options that speed up failure detection and message retransmission at the expense increased message size and number.

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