Comparing version
@@ -0,0 +0,0 @@ var wrk = require('../index.js'); |
21
index.js
@@ -28,8 +28,11 @@ var exec = require('child_process').exec; | ||
// the caller may have requested that we pass options to the exec | ||
const { execOptions={} } = opts | ||
cmd += ' ' + opts.url; | ||
var child = exec(cmd, function(error, stdout, stderr) { | ||
opts.debug && console.log(cmd); | ||
var child = exec(cmd, execOptions, function(error, stdout, stderr) { | ||
if (opts.debug) { | ||
console.log('stdout:\n', stdout); | ||
console.log('stderr:\n', stderr); | ||
stdout && console.log(stdout); | ||
stderr && console.error(stderr); | ||
} | ||
@@ -42,12 +45,2 @@ if (error) { | ||
}); | ||
child.on('close', function(code, signal) { | ||
if (code === null) { | ||
return callback(new Error('killed by signal: %s', signal)); | ||
} | ||
if (code !== 0) { | ||
return callback(new Error('died with exit code: %s', code)); | ||
} | ||
}); | ||
} | ||
@@ -54,0 +47,0 @@ |
@@ -0,0 +0,0 @@ module.exports = parseWrk |
{ | ||
"name": "wrk", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "wrk load test tool wrapper and output parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,3 @@ # node-wrk | ||
printLatency: true, | ||
headers: { cookie: 'JSESSIONID=abcd' }, | ||
url: 'http://localhost:3000/' | ||
@@ -39,2 +40,3 @@ }, function(err, out) { | ||
- `printLatency` | ||
- `headers`: object with additional request headers | ||
- `url`: target url | ||
@@ -41,0 +43,0 @@ - `path`: path to wrk binary (default is "wrk") |
@@ -0,0 +0,0 @@ var test = require('tap').test; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
Found 1 instance in 1 package
11547
3.52%88
2.33%1
-50%245
-2%