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.1 to 0.1.2

7

CHANGELOG.md

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

## [0.1.2](https://github.com/ayZagen/pino-kafka/compare/v0.1.1...v0.1.2) (2021-04-10)
### Features
* **cli:** flush kafka queue on process exit ([5793b40](https://github.com/ayZagen/pino-kafka/commit/5793b40c750aa701e76a3ca52a746ff89a4860a5))
## [0.1.1](https://github.com/ayZagen/pino-kafka/compare/v0.1.0...v0.1.1) (2021-04-10)

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

32

cli.js

@@ -9,2 +9,3 @@ #! /usr/bin/env node

const pinoKafka = require('./pkafka')
const util = require("util");

@@ -55,5 +56,34 @@ function keysToDotNotation(obj, current, final) {

}
const stream = pinoKafka(opts)
pump(process.stdin, stream)
pump(process.stdin, pinoKafka(opts))
function terminator( sig ) {
if ( typeof sig === 'string' ) {
flushKafkaQueue(function (err) {
process.exit(err ? 1 : 0);
});
}
}
async function flushKafkaQueue( callback ){
stream._kafka.flush(opts.timeout, err => {
if(err){
process.stderr.write(util.format.apply(this, err) + '\n')
}
callback(err)
})
}
['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',
'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'
].forEach(function (sig) {
process.on(sig, function () {
try {
terminator(sig);
} catch (e) {
process.exit(1)
}
});
});
}

@@ -60,0 +90,0 @@

2

package.json
{
"name": "pino-kafka",
"version": "0.1.1",
"version": "0.1.2",
"description": "A pino 'transport' for writing to kafka",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/ayZagen/pino-kafka",

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