2.0.12 • Published 2 years ago

length-prefix-framed-stream v2.0.12

Weekly downloads
79
License
BSD-2-Clause
Repository
github
Last release
2 years ago

npm License Open Bundle downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

length-prefix-framed-stream

Stream framing with length prefixes

import { pipeline } from "stream";
import { Encode } from "length-prefix-framed-stream";

const encode = new Encode();

pipeline(encode, aSendStream, e => {});

encode.write("message 1");
encode.write("message 2");
import { pipeline } from "stream";
import { Decode } from "length-prefix-framed-stream";

const decode = new Decode({ objectMode: true, encoding: "utf8" });

pipeline(aReceiveStream, decode, e => {});

for await (const message of decode) {
    console.log(message); // whole messages as put in above
}

API

Table of Contents

install

With npm do:

npm install length-prefix-framed-stream

license

BSD-2-Clause

2.0.12

2 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.7

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago