open-index/open-npm huggingface dataset:
npm package: @loadstrike/loadstrike-sdk
Description: TypeScript and JavaScript SDK for in-process load execution, traffic correlation, and reporting.
Latest version: 1.0.18001

# LoadStrike SDK for TypeScript and JavaScript

LoadStrike is a developer-first load testing SDK for Node.js applications, services, and test suites. Use it when you want to model real transactions in code, execute them in-process, and capture structured results without moving into a separate runner or DSL.

## What This SDK Is For

- Author scenario-based load tests in TypeScript or JavaScript.
- Exercise HTTP and event-driven workflows across multiple steps.
- Apply load simulations, thresholds, and custom metrics to real transactions.
- Generate local reports and, on eligible plans, publish observability data to supported sinks.

Built-in transport coverage includes HTTP, Kafka, RabbitMQ, NATS, Redis Streams, Azure Event Hubs, Push Diffusion, and delegate-based custom streams. Local report output supports HTML, Markdown, TXT, and CSV, and eligible plans can publish to InfluxDB, TimescaleDB, Grafana Loki, Datadog, Splunk HEC, and OpenTelemetry Collector.

## Requirements

- Node.js 20 or later

## Install

```bash
npm install @loadstrike/loadstrike-sdk
```

## Quick Start

```ts
import {
  LoadStrikeResponse,
  LoadStrikeRunner,
  LoadStrikeScenario,
  LoadStrikeSimulation,
  LoadStrikeStep,
} from "@loadstrike/loadstrike-sdk";

const scenario = LoadStrikeScenario
  .create("orders", async (context) => {
    return LoadStrikeStep.run(
      "publish-order",
      context,
      async () => LoadStrikeResponse.ok("200")
    );
  })
  .withLoadSimulations(
    LoadStrikeSimulation.inject(10, 1, 20)
  );

const result = await LoadStrikeRunner
  .registerScenarios(scenario)
  .withRunnerKey("rkl_your_runner_key")
  .run();
```

`run()` returns the detailed run result, including generated report files, scenario statistics, metrics, and sink status.

## Runner Keys

Runnable workloads require a `RunnerKey`. Supply it with `.withRunnerKey(...)` or through your application configuration before calling `run()`.

## Documentation

- Product documentation: https://loadstrike.com/documentation