Skip to content

lostsource/buffer-read-await

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

buffer-read-await

Asynchronously read data from incoming buffer stream

Installation

npm install buffer-read-await

Usage

Create a reader

const BufferReadAwait = require('buffer-read-await');
bfrReader = BufferReadAwait.alloc(1024);

Append data

bfrReader.append(buffer);

Read data

Any of the standard NodeJS Buffer readers can be used. (readInt8, readUInt8, readInt16BE, readInt16LE, readUInt16BE, readUInt16LE, readInt32BE, readInt32LE, readUInt32BE, readUInt32LE, readBigInt64BE, readBigInt64LE, readBigUInt64BE, readBigUInt64LE)

let testbyte = await bfrReader.readUInt8();

The promise will resolve once enough data has been appended.

About

asynchronously read data from incoming buffer stream

Resources

License

Stars

Watchers

Forks

Packages

No packages published