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

loadtest

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loadtest - npm Package Compare versions

Comparing version 6.3.1 to 6.3.2

2

package.json
{
"name": "loadtest",
"version": "6.3.1",
"version": "6.3.2",
"type": "module",

@@ -5,0 +5,0 @@ "description": "Run load tests for your web application. Mostly ab-compatible interface, with an option to force requests per second. Includes an API for automated load testing.",

@@ -303,26 +303,5 @@ [![run on repl.it](http://repl.it/badge/github/alexfernandez/loadtest)](https://repl.it/github/alexfernandez/loadtest)

Use custom request generator function from an external file.
Example request generator module could look like this:
```javascript
module.exports = function(params, options, client, callback) {
generateMessageAsync(function(message) {
if (message)
{
options.headers['Content-Length'] = message.length;
options.headers['Content-Type'] = 'application/x-www-form-urlencoded';
}
request = client(options, callback);
if (message){
request.write(message);
}
return request;
}
}
```
See [`sample/request-generator.js`](sample/request-generator.js) for some sample code including a body
Use a custom request generator function from an external file.
See an example of a request generator module in [`--requestGenerator`](#requestGenerator) below.
Also see [`sample/request-generator.js`](sample/request-generator.js) for some sample code including a body
(or [`sample/request-generator.ts`](sample/request-generator.ts) for ES6/TypeScript).

@@ -669,3 +648,4 @@

Custom request generator function.
Use a custom request generator function.
The request needs to be generated synchronously and returned when this function is invoked.

@@ -676,14 +656,9 @@ Example request generator function could look like this:

function(params, options, client, callback) {
generateMessageAsync(function(message)) {
request = client(options, callback);
if (message)
{
options.headers['Content-Length'] = message.length;
options.headers['Content-Type'] = 'application/x-www-form-urlencoded';
request.write(message);
}
request.end();
}
const message = generateMessage();
const request = client(options, callback);
options.headers['Content-Length'] = message.length;
options.headers['Content-Type'] = 'application/x-www-form-urlencoded';
request.write(message);
request.end();
return request;
}

@@ -690,0 +665,0 @@ ```

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