# length-prefixed-message

> Reads and writes binary length prefixed messages.

Latest version **3.0.4** (published 2019-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install length-prefixed-message
pnpm add length-prefixed-message
yarn add length-prefixed-message
bun add length-prefixed-message
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2019-08-07 |
| First published | 2014-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Eduardo Sorribas |
| Maintainers | sorribas |
| Keywords | binary, message, prefixed |

## Links

- npm: https://www.npmjs.com/package/length-prefixed-message
- Repository: https://github.com/sorribas/length-prefixed-message
- Issues: https://github.com/sorribas/length-prefixed-message/issues
- npm.io page: https://npm.io/package/length-prefixed-message

## Dependencies (1)

- [varint](https://npm.io/package/varint.md) ^3.0.1

## Recent versions

- 3.0.4 (latest) — 2019-08-07
- 3.0.3 — 2014-08-24
- 3.0.2 — 2014-08-16
- 3.0.1 — 2014-08-16
- 3.0.0 — 2014-08-16
- 1.1.0 — 2014-08-16
- 1.0.0 — 2014-08-15

## README

#length-prefixed-message


[![build status](https://travis-ci.org/sorribas/length-prefixed-message.png)](https://travis-ci.org/sorribas/length-prefixed-message.png)

Reads and writes binary length prefixed messages.

##Install

```
npm install length-prefixed-message
```

##Example

```js
var lpm = require('length-prefixed-message');

lpm.read(someStream, function(msgBuffer) {
    console.log(msgBuffer.toString());
});

lpm.write(someOtherStream, new Buffer('hello world'));

// or you can just pass a string if you want.
lpm.write(someOtherStream, 'hello world');
```

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