2.0.12 • Published 1 year ago

length-prefix-framed-stream v2.0.12

Weekly downloads
79
License
BSD-2-Clause
Repository
github
Last release
1 year 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

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

2.0.7

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

4 years ago

1.0.0

4 years ago