# Introduction

A generic, zero-dependency config-file loader

Package: @cookiemonsterdev/kafka-config 1.4.2
Canonical: https://cookiemonsterdev.github.io/kafka/docs/config/start/introduction/
Source revision: b112a684d2b3cdc7deadb3513041fcdbdc1c18b5

`@cookiemonsterdev/kafka-config` is a generic config-file loader: discovery, sync/async loading, a
TypeScript transform rescue, layer merging, and diagnostics. It has **zero runtime dependencies**
and no knowledge of Kafka, or of any other specific consumer.

[`@cookiemonsterdev/kafka-core`](https://cookiemonsterdev.github.io/kafka/docs/core/reference/config-file/) uses it to load
`kafka.config.ts` through `Kafka.fromConfig()` and `new Kafka()`, and the CLI and studio build on
it too. Any other consumer can use the same discovery/loading/merging machinery instead of writing
it again.

## Install

```sh
npm install @cookiemonsterdev/kafka-config
```

It runs on Node.js 24 or newer and on Bun 1.4 or newer. See
[Bun](https://cookiemonsterdev.github.io/kafka/docs/core/reference/bun/#config-loading) for how config loading differs there.

## Why a separate package

The loader machinery has no Kafka-specific code in it at all — file discovery, `require()`/
`import()` handling, the TypeScript transform rescue, and layer merging are all generic. Shipping
it as its own package means a fix or improvement reaches every consumer through a normal version
bump, instead of requiring a new release of each package that happens to use it.

Next: [API reference](https://cookiemonsterdev.github.io/kafka/docs/config/reference/api/).

Next practical step: [Getting started](https://cookiemonsterdev.github.io/kafka/docs/config/start/getting-started/).
