Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indix/kafkajs-lz4
đ LZ4 compression codec for KafkaJS
https://github.com/indix/kafkajs-lz4
indix kafka lz4 node typescript
Last synced: about 2 months ago
JSON representation
đ LZ4 compression codec for KafkaJS
- Host: GitHub
- URL: https://github.com/indix/kafkajs-lz4
- Owner: indix
- License: mit
- Created: 2018-09-28T14:14:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T22:30:58.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T21:47:30.766Z (2 months ago)
- Topics: indix, kafka, lz4, node, typescript
- Language: TypeScript
- Size: 367 KB
- Stars: 15
- Watchers: 20
- Forks: 8
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# kafkajs-lz4
[![Build Status](https://img.shields.io/github/workflow/status/indix/kafkajs-lz4/Test?logo=github-actions&longCache=true&style=flat-square)](https://travis-ci.org/indix/kafkajs-lz4) [![NPM Version](https://img.shields.io/npm/v/kafkajs-lz4.svg?longCache=true&style=flat-square)](https://www.npmjs.com/package/kafkajs-lz4) ![](https://img.shields.io/badge/typescript-4.1-blue.svg?longCache=true&style=flat-square)
TypeScript-ready [lz4](https://www.npmjs.com/package/lz4) compression codec for [KafkaJS](https://www.npmjs.com/package/kafkajs).
âšī¸ Requires Node v10 or above to work.
## Install
```bash
$ yarn add kafkajs-lz4
```## Usage
```typescript
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](https://www.npmjs.com/package/lz4-asm#lz4compresssource-options).
### Example
To set the highest level of compression for your Kafka messages â
```typescript
const lz4Codec = new LZ4Codec({
preferences: {
compressionLevel: 16
}
}).codec;CompressionCodecs[CompressionTypes.LZ4] = lz4Codec;
```