lz4-stream-buffer
v1.0.1
Published
Async LZ4 compression and decompression for buffers and files using Node.js.
Maintainers
Readme
lz4-stream-buffer
Async LZ4 compression and decompression for buffers and files using Node.js.
This package provides a very fast and simple way to compress and decompress data using LZ4. It uses the native @pierrec/node-lz4 module for maximum speed.
Features
- Asynchronous API with Promise support
- Compress Buffer data directly to .lz4 files
- Decompress .lz4 files to Buffer
- Powered by the fast native
@pierrec/node-lz4dependency
Installation
npm install lz4-stream-bufferUsage
const { lz4Compress, lz4Decompress } = require('lz4-stream-buffer');
// Compress a buffer to a file
const buffer = Buffer.from('Hello LZ4!');
const compressed = await lz4Compress(buffer);
// Decompress a file to a buffer
const originalBuffer = await lz4Decompress(compressed);
console.log(originalBuffer.toString()); // 'Hello LZ4!'License
MIT
