npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

async-kafka

v0.8.4

Published

A promise based client for Kafka built on top of node-rdkafka, encapsulating best practice and hiding peculiarities

Readme

AsyncKafka

This package is a promise based async client for Kafka that wraps the packages node-rdkafka and avro-schema-registry to create a high level, high preforming NPM Package for consuming and producing topics on Kafka.
The package aim to provide a solid user friendly Kafka client that can be used for common usage senarios of Kafka including shared state storage in compacted topics. The client try to encapsulate best practice and experience working with both Kafka and node-rdkafka and to protect users against common pittfalls and performance impacts by trying to balance these.

Documentation

Documentation is FINALLY found here!

Installation

npm install async-kafka

The package depends on the node.js wraper node-rdkafka for the very efficent C++ librdkafka library for Kafka. This package uses gyp to install. For spesific install condsiderations for node-rdkafka please visit node-rdkafka.

Other dependencies: async, avro-schema-registry, avsc, clone, uuid

Status

In early phase but elements of consumer and producer is derived from a previous long duration tested consumers and producers.

Releases and release notes

Bugs may exist -> Please report bugs in repository

Features

  • All interaction with client is done with asyncfunctions (returns promise).
  • Fast, low latency, low memory and cpu friendly
  • Smart handling of Kafka, librdkafka and node-rdkafka quirks and oddities
  • Internal queue and backpreassure handling
  • Default values for all settings
  • Configurable options for performance tuning
  • Configurable stats and logging
  • Decoding and encoding of avro, json and string messages
  • Automatic lookup of avro schema in schema registry
  • Gracefull shutdown of clients on external signals (SIGINT, SIGTERM) and on unhandled promise rejections and uncaught exeptions.

Consumer features

  • Configurable auto commit interval
  • Auto detection and decoding of AVRO and JSON messages
  • Automatic lookup and retrival of AVRO schemas in schema register
  • Automatic handling of reassignments and rebalancing
  • Adding and removing topic subscriptions on the fly without loosing offsets on existing subscriptions

Per topic consumer features

  • Set message decoder type or provide custom async decoder
  • Consume from earliest, latest, next or last commited message, regardless of previous commits
  • Configurable auto commit that will commit at consumer configured interval
  • Ensure commit of last processed message before unassign of partition if auto commit is enabled.
  • On graceful shutdown try to commit last prosessed offsets for topic partitions with previous commits in subscribe session
  • Configurable resume from last offset on reassign regadless of commits
  • Three stage processig with user defined async filter, map and process functions
  • Detection of eof to notify that topics are read up to current offset
  • Immediate detection of end of file on empty topics

Producer features

  • Encoding of JSON, STRING and BUFFER (binary) messages (TO-DO: AVRO)
  • Automatic lookup and retrival of AVRO schemas in schema register based on configuration
  • Automatic queue size based on desired maximum messages in flight without delivery confirmation
  • Backpressure handling trough promises
  • Optional async callback on delivery acknowledgement with tracking token.

Admin features (TO-DO)

  • Create, change and delete topics on broker
  • Create, change and delete schemas in schema registry

Versioning

AsyncKafka uses a [major].[minor].[patch] versioning scheme with the following change definitions.

  • Major: Release with majore rework or changes to functionality that can break backward compability.
  • Minor: Release with new functionality but backward compatible with earlier versions of same major version.
  • Patch: Release with bugfixes or optimization not changing the functionality of minor version.

TO-DO

  • 0% Test coverage can't be good
  • High level admin client
  • More examples and usage documentation