Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino-kafka

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-kafka - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.husky/commit-msg

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [0.1.1](https://github.com/ayZagen/pino-kafka/compare/v0.1.0...v0.1.1) (2021-04-10)
### Features
* expose kafka stream ([a1a0e2f](https://github.com/ayZagen/pino-kafka/commit/a1a0e2faf70ab8a2906307c4472b20c2a74afc14))
# 0.1.0 (2021-01-18)

@@ -2,0 +9,0 @@

25

package.json
{
"name": "pino-kafka",
"version": "0.1.0",
"version": "0.1.1",
"description": "A pino 'transport' for writing to kafka",
"homepage": "https://github.com/pinojs/pino-kafka",
"bugs": "https://github.com/pinojs/pino-kafka/issues",
"homepage": "https://github.com/ayZagen/pino-kafka",
"bugs": "https://github.com/ayZagen/pino-kafka/issues",
"main": "pkafka.js",

@@ -32,9 +32,9 @@ "scripts": {

"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@release-it/conventional-changelog": "^2.0.0",
"husky": "^4.3.8",
"mocha": "^8.2.1",
"pino": "^6.11.0",
"release-it": "^14.2.2"
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@release-it/conventional-changelog": "^2.0.1",
"husky": "^6.0.0",
"mocha": "^8.3.2",
"pino": "^6.11.2",
"release-it": "^14.6.0"
},

@@ -44,7 +44,2 @@ "engines": {

},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"release-it": {

@@ -51,0 +46,0 @@ "plugins": {

2

pkafka.js

@@ -75,4 +75,6 @@ const stream = require('stream')

through._kafka = kafkaStream
return through;
}

@@ -12,3 +12,3 @@ <p align="center">

```bash
```shell
$ npm install --production -g pino-kafka

@@ -28,6 +28,6 @@ ### or with yarn

### CLI
Given an application `foo` that logs via [pino][pino], and a kafka broker listening on `10.10.10.5` you would use `pino-kafka` as:
Given an application `foo` that logs via [pino][pino], and a kafka broker listening on `10.10.10.5:9200` you would use `pino-kafka` as:
```bash
$ node foo | pino-kafka -b 10.10.10.5
$ node foo | pino-kafka -b 10.10.10.5:9200
```

@@ -41,3 +41,3 @@

const logger = pino({}, pkafka({ brokers: "10.10.10.5"}))
const logger = pino({}, pkafka({ brokers: "10.10.10.5:9200"}))
```

@@ -87,6 +87,6 @@ ## Options

```bash
$ yes | pino-kafka -s ./settings.json -b 10.10.10.11
$ yes | pino-kafka -s ./settings.json -b 10.10.10.11:9200
```
The connection will be made to address `10.10.10.11` with the default topic port `test`.
The connection will be made to address `10.10.10.11:9200` with the default topic `test`.

@@ -124,3 +124,37 @@ ### Kafka Settings

### Accessing Internal Kafka Producer
You can access `node-rdkafka` producer from pino stream with `_kafka`.
For example:
```js
const pino = require('pino')
const logger = pino({}, pkafka({ brokers: "10.10.10.5:9200"}))
logger[pino.symbols.streamSym]._kafka.getMetadata({}, (err, data)=> {
//...
})
```
## Testing
For running tests make sure you installed dependencies with `npm install` or `yarn` and have a running kafka.
More easily, if you have docker and docker-compose installed, you can create one with following.
```bash
$ cd pino-kafka
$ docker-compose up -d
```
Look at [docker-compose file](docker-compose.yml) for more details.
After you all setup, just run test command with following:
```bash
$ npm run test
# or with yarn
$ yarn test
```
> **NOTE**: If you use your own kafka setup, you may need to change test configuration accordingly to your needs(ip, topic etc.)
## License
[MIT](LICENSE)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc