@kafkajs/zstd
ZStandard codec for KafkaJS.
NOTE: This codec relies on cppzst for compression and decompression. Please divert any issues with cppzst there, and only open issues on this repo in case the version being used here needs to be updated.
This package is provided on a best-effort basis. See #2
Installation
npm install --save @kafkajs/zstd
Configuration
const { CompressionTypes, CompressionCodecs } = require('kafkajs')
const ZstdCodec = require('@kafkajs/zstd')
const compressionParams = { level: 1 }
const decompressionParams = {}
CompressionCodecs[CompressionTypes.ZSTD] = ZstdCodec(compressionParams, decompressionParams)
compressionParams
Optional Allows you to configure the compression level and training data.
{
level: 3,
dict: trainingData,
dictSize: Buffer.byteLength(trainingData)
}
decompressionParams
Optional Allows you to configure the training data.
{
dict: trainingData,
dictSize: Buffer.byteLength(trainingData)
}
Testing
$ docker-compose up -d && node scripts/waitForKafka.js
$ npm test
$ npm run test:watch
$ npm run test:types
$ npm run lint
License
See LICENSE for more details.