Skip to content
/ lfs-pack Public

JavaScript library used for packing and unpacking LFS packets

License

Notifications You must be signed in to change notification settings

makao/lfs-pack

Repository files navigation

LFS pack

JavaScript library used for packing and unpacking LFS InSim packets

Build Status Coverage Status

Installation

npm install --save @makao.pl/lfs-pack

Usage

Pack

// packing 4 unsigned chars into buffer
const buffer = pack('CCCC', [10, 20, 30, 40]);
console.log(buffer); // <Buffer 0a 14 1e 28>

Unpack

// unpacking 4 unsigned chars from buffer
const values = unpack('CCCC', Buffer.alloc(4));
console.log(values); // [0, 0, 0, 0]

License

MIT