js/commands/load

js/commands/load.ts

fino:commands/load — reusable HTTP and scripted-protocol load task.

Parses closed-loop or bounded open-loop HTTP workloads and TypeScript scenarios, then delegates execution to fino:load. HTTP mode pins HTTP/1.1, HTTP/2, or HTTP/3 explicitly; it does not silently fall back when the peer cannot speak the selected protocol. Responses stream into a byte counter by default, while --response cancel stops after final headers and records the run as headers-only.

Durations accept ms, s, m, or h suffixes. Use either --duration (10 seconds by default) or --requests, never both. JSON mode emits the versioned HTTP or scenario result from fino:load; text mode prints the corresponding shared human-readable summary. Scenario modules are imported from the command working directory and must default-export LoadScenario.

import loadCommand from 'fino:commands/load';

await loadCommand.parse([
  '--protocol', 'h2',
  '--connections', '10',
  '--streams', '20',
  '--duration', '30s',
  'https://localhost:3000/health',
]);

Constants

const command

The load subcommand mounted by the root Fino CLI.

It accepts one static HTTP URL or one TypeScript scenario. Text mode returns the formatted report string. JSON mode writes and returns the versioned result object. --quiet suppresses text output but never suppresses explicitly requested JSON.