# post-json-to-kafka

> ```bash yarn add post-json-to-kafka

Latest version **1.0.0** (published 2019-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install post-json-to-kafka
pnpm add post-json-to-kafka
yarn add post-json-to-kafka
bun add post-json-to-kafka
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-06-20 |
| First published | 2019-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Maxime ROBIN |
| Maintainers | waxo |

## Links

- npm: https://www.npmjs.com/package/post-json-to-kafka
- Repository: https://github.com/waxo/post-json-to-kafka
- npm.io page: https://npm.io/package/post-json-to-kafka

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [ramda](https://npm.io/package/ramda.md) ^0.26.1
- [kafka-node](https://npm.io/package/kafka-node.md) ^4.0.2

## Recent versions

- 1.0.0 (latest) — 2019-06-20
- 0.1.0 — 2019-05-17
- 0.0.3 — 2019-04-30
- 0.0.2 — 2019-03-19

## README

> Publish list of object to kafka

[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)

## Install
```bash
yarn add post-json-to-kafka

# or

npm install --save post-json-to-kafka
```

## Configuring
The location of kafka can be set by the environment variable:
```bash
KAFKA_URL=localhost:9092 # default
```

## Example usage

```js
const {sendToKafka} = require('post-json-to-kafka');

const exampleFunction = async () => {
  const somethingToAddInsideEachMessage = 'what you want string, object, list, number';
  const listOfJSON = [
    {key: 'value', key2: 'value2'},
    {key: 'value', something: 'value'}
  ];
  
   
  await sendToKafka('topic', somethingToAddInsideEachMessage, listOfJSON)
};

exampleFunction().then(() => {console.log('Everything is sent')});
```

## Debugging
This package uses the [debug package](https://www.npmjs.com/package/debug).
You can configure it with environment variables:
```bash
DEBUG=post-json-to-kafka:debug # only debug messages
DEBUG=post-json-to-kafka:trace # only trace messages
DEBUG=post-json-to-kafka:*     # every messages
```

---
_Source: https://npm.io/package/post-json-to-kafka · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
