Gathering detailed insights and metrics for kafkajs
Gathering detailed insights and metrics for kafkajs
Gathering detailed insights and metrics for kafkajs
Gathering detailed insights and metrics for kafkajs
@opentelemetry/instrumentation-kafkajs
OpenTelemetry instrumentation for `kafkajs` messaging client for Apache Kafka
kafkajs-snappy
Snappy codec for KafkaJS
opentelemetry-instrumentation-kafkajs
open telemetry instrumentation for the `kafkajs` kafka client
kafkajs-lz4
LZ4 compression codec for the KafkaJS library
npm install kafkajs
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3,761 Stars
3,097 Commits
529 Forks
37 Watching
27 Branches
116 Contributors
Updated on 27 Nov 2024
Minified
Minified + Gzipped
JavaScript (98.33%)
Shell (0.87%)
TypeScript (0.55%)
Java (0.14%)
CSS (0.11%)
Cumulative downloads
Total Downloads
Last day
-0.9%
230,159
Compared to previous day
Last week
2.1%
1,231,765
Compared to previous week
Last month
16.2%
4,946,848
Compared to previous month
Last year
26.3%
47,389,121
Compared to previous year
27
A modern Apache Kafka® client for Node.js
Get Started »
Read the Docs
·
Report Bug
·
Request Feature
KafkaJS is a modern Apache Kafka client for Node.js. It is compatible with Kafka 0.10+ and offers native support for 0.11 features.
KAFKA is a registered trademark of The Apache Software Foundation and has been licensed for use by KafkaJS. KafkaJS has no affiliation with and is not endorsed by The Apache Software Foundation.
1npm install kafkajs 2# yarn add kafkajs
1const { Kafka } = require('kafkajs') 2 3const kafka = new Kafka({ 4 clientId: 'my-app', 5 brokers: ['kafka1:9092', 'kafka2:9092'] 6}) 7 8const producer = kafka.producer() 9const consumer = kafka.consumer({ groupId: 'test-group' }) 10 11const run = async () => { 12 // Producing 13 await producer.connect() 14 await producer.send({ 15 topic: 'test-topic', 16 messages: [ 17 { value: 'Hello KafkaJS user!' }, 18 ], 19 }) 20 21 // Consuming 22 await consumer.connect() 23 await consumer.subscribe({ topic: 'test-topic', fromBeginning: true }) 24 25 await consumer.run({ 26 eachMessage: async ({ topic, partition, message }) => { 27 console.log({ 28 partition, 29 offset: message.offset, 30 value: message.value.toString(), 31 }) 32 }, 33 }) 34} 35 36run().catch(console.error)
Learn more about using KafkaJS on the official site!
Read something on the website that didn't work with the latest stable version?
Check the pre-release versions - the website is updated on every merge to master.
KafkaJS is an open-source project where development takes place in the open on GitHub. Although the project is maintained by a small group of dedicated volunteers, we are grateful to the community for bug fixes, feature development and other contributions.
See Developing KafkaJS for information on how to run and develop KafkaJS.
We welcome contributions to KafkaJS, but we also want to see a thriving third-party ecosystem. If you would like to create an open-source project that builds on top of KafkaJS, please get in touch and we'd be happy to provide feedback and support.
Here are some projects that we would like to build, but haven't yet been able to prioritize:
See LICENSE for more details.
Apache Kafka and Kafka are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries. KafkaJS has no affiliation with the Apache Software Foundation.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/10 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
56 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More