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

pino-elasticsearch

Package Overview
Dependencies
Maintainers
4
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-elasticsearch - npm Package Compare versions

Comparing version 6.6.0 to 6.7.0

test/cli.test.js

97

cli.js

@@ -36,2 +36,6 @@ #! /usr/bin/env node

if (opts.rejectUnauthorized) {
opts.rejectUnauthorized = opts.rejectUnauthorized !== 'false'
}
const stream = pinoElasticSearch(opts)

@@ -49,45 +53,64 @@

if (opts.rejectUnauthorized) {
opts.rejectUnauthorized = opts.rejectUnauthorized !== 'false'
}
pump(process.stdin, stream)
}
const flags = minimist(process.argv.slice(2), {
alias: {
version: 'v',
help: 'h',
node: 'n',
index: 'i',
'flush-bytes': 'f',
'flush-interval': 't',
'trace-level': 'l',
username: 'u',
password: 'p',
'api-key': 'k',
cloud: 'c',
'read-config': 'r'
},
default: {
node: 'http://localhost:9200'
function startCli (flags) {
const allowedProps = [
'node',
'index',
'flush-bytes',
'flush-interval',
'trace-level',
'username',
'password',
'api-key',
'cloud',
'es-version',
'rejectUnauthorized'
]
if (flags['read-config']) {
if (flags['read-config'].match(/.*\.json$/) !== null) {
const config = JSON.parse(fs.readFileSync(path.join(process.cwd(), flags['read-config']), 'utf-8'))
allowedProps.forEach(key => {
if (config[key] !== undefined) {
flags[key] = config[key]
}
})
}
if (flags['read-config'].match(/.*\.js$/) !== null) {
const config = require(path.join(process.cwd(), flags['read-config']))
allowedProps.forEach(key => {
if (config[key] !== undefined) {
flags[key] = config[key]
}
})
}
}
})
const allowedProps = ['node', 'index', 'flush-bytes', 'flush-interval', 'trace-level', 'username', 'password', 'api-key', 'cloud', 'es-version', 'rejectUnauthorized']
start(flags)
}
if (flags['read-config']) {
if (flags['read-config'].match(/.*\.json$/) !== null) {
const config = JSON.parse(fs.readFileSync(path.join(process.cwd(), flags['read-config']), 'utf-8'))
allowedProps.forEach(key => {
if (config[key]) { flags[key] = config[key] }
})
}
if (require.main === module) {
startCli(minimist(process.argv.slice(2), {
alias: {
version: 'v',
help: 'h',
node: 'n',
index: 'i',
'flush-bytes': 'f',
'flush-interval': 't',
'trace-level': 'l',
username: 'u',
password: 'p',
'api-key': 'k',
cloud: 'c',
'read-config': 'r'
},
default: {
node: 'http://localhost:9200'
}
}))
}
if (flags['read-config'].match(/.*\.js$/) !== null) {
const config = require(path.join(process.cwd(), flags['read-config']))
allowedProps.forEach(key => {
if (config[key]) { flags[key] = config[key] }
})
}
}
start(flags)
module.exports = startCli
{
"name": "pino-elasticsearch",
"version": "6.6.0",
"version": "6.7.0",
"description": "Load pino logs into ElasticSearch",

@@ -33,3 +33,3 @@ "main": "./lib.js",

"tap": "^16.0.0",
"tsd": "^0.28.1"
"tsd": "^0.29.0"
},

@@ -36,0 +36,0 @@ "dependencies": {

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