# kafkajs-lz4

> LZ4 compression codec for the KafkaJS library

Latest version **2.0.0-beta.0** (published 2020-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install kafkajs-lz4
pnpm add kafkajs-lz4
yarn add kafkajs-lz4
bun add kafkajs-lz4
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0-beta.0 |
| Published | 2020-12-04 |
| First published | 2018-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | GP |
| Maintainers | gprasannah |
| Keywords | kafka, kafkajs, compression, lz4, codec |

## Links

- npm: https://www.npmjs.com/package/kafkajs-lz4
- Repository: https://github.com/indix/kafkajs-lz4
- Homepage: https://oss.indix.com/
- Issues: https://github.com/indix/kafkajs-lz4/issues
- npm.io page: https://npm.io/package/kafkajs-lz4

## Dependencies (1)

- [lz4-asm](https://npm.io/package/lz4-asm.md) 0.4.2

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 2.0.0-beta.0 (latest) — 2020-12-04
- 1.2.1 — 2019-08-14
- 1.1.0 — 2018-09-30
- 1.0.2 — 2018-09-29
- 1.0.1 — 2018-09-29
- 1.0.0 — 2018-09-29

## README

# kafkajs-lz4

[![Build Status](https://img.shields.io/travis/indix/kafkajs-lz4/master.svg?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;
```

---
_Source: https://npm.io/package/kafkajs-lz4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
