Détail du package

kafkajs-lz4

indix91.1kMIT2.0.0-beta.0

LZ4 compression codec for the KafkaJS library

kafka, kafkajs, compression, lz4

readme

kafkajs-lz4

Build Status NPM Version

TypeScript-ready lz4 compression codec for KafkaJS.

ℹ️ Requires Node v10 or above to work.

Install

$ yarn add kafkajs-lz4

Usage

import { CompressionTypes, CompressionCodecs } from 'kafkajs';
import LZ4Codec from 'kafkajs-lz4';

CompressionCodecs[CompressionTypes.LZ4] = new LZ4Codec().codec;

Options

All options are transparently passed on to the lz4-asm library's compress options.

Example

To set the highest level of compression for your Kafka messages —

const lz4Codec = new LZ4Codec({
    preferences: {
        compressionLevel: 16
    }
}).codec;

CompressionCodecs[CompressionTypes.LZ4] = lz4Codec;

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.0.0] - 2020-12-04

Changed

  • ⚡️ Replace core dependency lz4 with the much better maintained lz4-asm library. Note that this requires Node v10 or above to work!
  • Upgraded all dependencies (including running tests on Kafka v2.5.0)
  • Replace Travis CI with Github Actions.
  • Migrate to ESLint from TSLint (now that the TSLint project is deprecated).

[1.2.1] - 2019-08-14

Fixed

  • TS errors in tests — via 688a42c.

[1.2.0] - 2019-08-14

Fixed

  • Node.js v12 compatibility — via #1. Thanks @ankon!

[1.1.0] - 2018-09-30

Changed

  • Updated return type for codec() from class property to function.

[1.0.2] - 2018-09-29

Added

  • ⚡️ Full end-to-end tests on Kafka.

[1.0.1] - 2018-09-29

Changed

  • Relicensed to MIT.

[1.0.0] - 2018-09-29

Added

  • Initial release 🎉