pino-socket
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -21,3 +21,3 @@ 'use strict' | ||
const port = server.address().port | ||
const psock = spawn('node', [ psockPath, '-m', 'tcp', '-a', address, '-p', port ]) | ||
const psock = spawn('node', [psockPath, '-m', 'tcp', '-a', address, '-p', port]) | ||
psock.on('close', (code, signal) => console.log('psock closed: (%s, %s)', code, signal)) | ||
@@ -24,0 +24,0 @@ psock.on('error', (err) => console.error('psock error: %s', err.message)) |
@@ -19,2 +19,3 @@ | ||
-p | --port the port on the destination socket; default: '514' | ||
-u | --unixsocket the path of unix socket, default: '' | ||
-r | --reconnect enable tcp mode reconnecting | ||
@@ -21,0 +22,0 @@ -t | --reconnectTries number of reconnect attempts to make; default 'Inifinity' |
@@ -58,3 +58,3 @@ 'use strict' | ||
socket = net.createConnection( | ||
{ host: options.address, port: options.port }, | ||
options.unixsocket ? { path: options.unixsocket } : { host: options.address, port: options.port }, | ||
() => { | ||
@@ -61,0 +61,0 @@ connecting = false |
{ | ||
"name": "pino-socket", | ||
"version": "2.0.0", | ||
"description": "A pino 'transport' for writing to a tcp or udp socket", | ||
"version": "3.0.0", | ||
"description": "A pino 'transport' for writing to a tcp, udp, or unix socket", | ||
"homepage": "https://github.com/pinojs/pino-socket", | ||
@@ -27,7 +27,7 @@ "bugs": "https://github.com/pinojs/pino-socket/issues", | ||
"chai": "^4.2.0", | ||
"mocha": "^6.0.2", | ||
"nyc": "^13.3.0", | ||
"pino": "^5.11.1", | ||
"mocha": "^8.0.1", | ||
"nyc": "^15.1.0", | ||
"pino": "^6.3.2", | ||
"pre-commit": "^1.1.3", | ||
"standard": "^12.0.1" | ||
"standard": "^14.3.4" | ||
}, | ||
@@ -34,0 +34,0 @@ "dependencies": { |
@@ -13,2 +13,3 @@ 'use strict' | ||
let options = { | ||
unixsocket: '', | ||
address: '127.0.0.1', | ||
@@ -23,2 +24,3 @@ mode: 'udp', | ||
const longOpts = { | ||
unixsocket: String, | ||
address: String, | ||
@@ -35,2 +37,3 @@ mode: ['tcp', 'udp'], | ||
const shortOpts = { | ||
u: '--unixsocket', | ||
a: '--address', | ||
@@ -37,0 +40,0 @@ m: '--mode', |
@@ -26,2 +26,6 @@ # pino-socket | ||
``` | ||
OR | ||
```bash | ||
$ node foo | pino-socket -u /tmp/unix.sock | ||
``` | ||
@@ -31,2 +35,3 @@ ## Options | ||
+ `--settings` (`-s`): read settings from a JSON file (switches take precedence) | ||
+ `--unixsocket` (`-u`): the unix socket path for the destination. Default: ``. | ||
+ `--address` (`-a`): the address for the destination socket. Default: `127.0.0.1`. | ||
@@ -33,0 +38,0 @@ + `--mode` (`-m`): either `tcp` or `udp`. Default: `udp`. |
@@ -14,5 +14,5 @@ 'use strict' | ||
const scriptPath = path.join(__dirname, 'fixtures', 'issue5.js') | ||
const script = spawn('node', [ scriptPath ]) | ||
const script = spawn('node', [scriptPath]) | ||
const psockPath = path.join(__dirname, '..', 'psock.js') | ||
const psock = spawn('node', [ psockPath, '-a', server.address().address, '-p', server.address().port, '-m', 'tcp', '-ne' ]) | ||
const psock = spawn('node', [psockPath, '-a', server.address().address, '-p', server.address().port, '-m', 'tcp', '-ne']) | ||
@@ -19,0 +19,0 @@ let output = '' |
@@ -70,3 +70,3 @@ 'use strict' | ||
'node', | ||
[ `${__dirname}/../psock.js`, '-a', address, '-p', port, '-m', 'tcp', '-r', '-t', 2 ] | ||
[`${__dirname}/../psock.js`, '-a', address, '-p', port, '-m', 'tcp', '-r', '-t', 2] | ||
) | ||
@@ -73,0 +73,0 @@ // for debugging |
@@ -38,3 +38,3 @@ 'use strict' | ||
setTimeout(() => { | ||
let server = startServer({ next, port: 2030 }) | ||
const server = startServer({ next, port: 2030 }) | ||
@@ -60,3 +60,3 @@ function next (msg) { | ||
'node', | ||
[ `${__dirname}/../psock.js`, '-a', address, '-p', port, '-m', 'tcp', '-r' ] | ||
[`${__dirname}/../psock.js`, '-a', address, '-p', port, '-m', 'tcp', '-r'] | ||
) | ||
@@ -63,0 +63,0 @@ // for debugging |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24154
21
642
83
7
18