
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
kafkajs-lz4
Advanced tools
TypeScript-ready lz4 compression codec for KafkaJS.
ℹ️ Requires Node v10 or above to work.
$ yarn add kafkajs-lz4
import { CompressionTypes, CompressionCodecs } from 'kafkajs';
import LZ4Codec from 'kafkajs-lz4';
CompressionCodecs[CompressionTypes.LZ4] = new LZ4Codec().codec;
All options are transparently passed on to the lz4-asm library's compress options.
To set the highest level of compression for your Kafka messages —
const lz4Codec = new LZ4Codec({
preferences: {
compressionLevel: 16
}
}).codec;
CompressionCodecs[CompressionTypes.LZ4] = lz4Codec;
FAQs
LZ4 compression codec for the KafkaJS library
The npm package kafkajs-lz4 receives a total of 13,536 weekly downloads. As such, kafkajs-lz4 popularity was classified as popular.
We found that kafkajs-lz4 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.