@confluentinc/kafka-javascript

@confluentinc/kafka-javascript as the Newer Option

Confluent 17,245 's confluent-kafka-javascript (https://github.com/confluentinc/confluent-kafka-javascript 308 ) (MIT; 1.0 on 16 December 2024, 1.10.1 on 10 September 2026) builds on node-rdkafka and librdkafka 2.15.1, with a KafkaJS-like promise API (.KafkaJS) and node-rdkafka's callback API. Prebuilt binaries cover Node.js 18-24 2,131 on Linux, macOS and Windows; npm 11.19 2,036 asks you to approve its install script, which downloads the binary (npm install-scripts approve @confluentinc/kafka-javascript). Migrating from KafkaJS means changing the require, wrapping the options in a kafkaJS object, and moving per-call settings (acks on send(), fromBeginning on subscribe(), autoCommit on run()) into the client configuration. clients/node/keys.js runs on either library; this script runs it with both, beside Python and Java, on a fresh three-partition topic:

clients/keys_all.sh: five clients write keys 1-12; where did each key go?Shell
cd clients && PY=/home/dev/v7-l2/venv-kafka/bin/python
$PY keys.py                                             # librdkafka: CRC32, then murmur2
(cd node && node keys.js kafkajs 2>/dev/null && node keys.js confluent)
seq 1 12 | sed 's/$/|java/' | docker exec -i l2-kafka \
  /opt/kafka/bin/kafka-console-producer.sh --bootstrap-server l2-kafka:9092 \
  --topic booknest.partition-check \
  --reader-property parse.key=true --reader-property key.separator='|'   # the Java client
$PY keys_report.py
Output
python          2 1 1 1 1 1 0 2 0 0 0 0
python-murmur2  0 2 2 1 0 1 0 0 2 1 0 1
kafkajs         0 2 2 1 0 1 0 0 2 1 0 1
confluent       0 2 2 1 0 1 0 0 2 1 0 1
java            0 2 2 1 0 1 0 0 2 1 0 1

The Confluent client's KafkaJS API defaults to murmur2_random, while Python on the same librdkafka keeps CRC32: a Python producer joining a Java or Node.js topic must set partitioner.