npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stressor-cli

v0.0.2

Published

CLI tool for stress/performance testing

Readme

Stressor CLI

Info

Stressor CLI es una interfaz de línea de comandos para ejecutar pruebas de rendimiento, carga y auditorías usando stressor-core. Combina la potencia de k6 para pruebas de carga y Lighthouse para auditorías en una herramienta fácil de usar desde terminal.

Resumen de características

  • Interfaz CLI intuitiva - Comandos simples y bien documentados
  • Formatos de salida múltiples - JSON, YAML, tabla, CSV
  • Configuración flexible - Archivos YAML/JSON o parámetros CLI
  • Ejecución en paralelo - Soporte para tests simultáneos
  • Logging detallado - Verbose mode y salida silenciosa
  • Validación integrada - Verificación automática de configuraciones

Instalación

Global (recomendado)

npm install -g stressor-cli
# o
pnpm add -g stressor-cli
# o
yarn global add stressor-cli

Local

npm install --save-dev stressor-cli
# o
pnpm add -D stressor-cli

Desde fuente (para desarrollo)

git clone https://github.com/rodnye/stressor-cli.git
cd stressor-cli
pnpm install
pnpm build
pnpm link --global

Ejemplo de usos

# Mostrar ayuda
stressor --help

# Ejecutar tests desde archivo de configuración
stressor run -c config.yaml

# Ejecutar audit test directo
stressor test audit --url https://example.com

# Ejecutar load test directo
stressor test load --scenario ./tests/api.yml --vus 20 --duration 1m

Comandos básicos

stressor run

Ejecuta tests desde un archivo de configuración.

stressor run -c config.yaml
stressor run -c config.json --name "Mi Test" --parallel
stressor run -c config.yaml --output json --output-file results.json

Opciones:

  • -c, --config <path> - Ruta al archivo de configuración (YAML/JSON) (requerido)
  • --name <name> - Sobrescribir nombre del test suite
  • --owner <owner> - Sobrescribir propietario del test
  • --id <id> - Sobrescribir ID del test
  • --parallel - Ejecutar tests en paralelo
  • --timeout <ms> - Timeout en milisegundos
  • --save-raw - Guardar datos de salida crudos
  • -o, --output <format> - Formato de salida (json, yaml, table)
  • --output-file <path> - Escribir salida a archivo

stressor test audit

Ejecuta una auditoría Lighthouse.

stressor test audit --url https://example.com
stressor test audit --url https://example.com --form-factor mobile --categories performance,seo
stressor test audit --url https://example.com --show-audits --output json

Opciones:

  • --url <url> - URL a auditar (requerido)
  • --form-factor <type> - Factor de forma (mobile|desktop, default: desktop)
  • --categories <items> - Categorías (comma-separated, default: performance,seo,accessibility,best-practices)
  • --show-audits - Mostrar auditorías detalladas
  • --chrome-path <path> - Ruta personalizada a Chrome
  • -o, --output <format> - Formato de salida (json, yaml, table)

stressor test load

Ejecuta una prueba de carga.

stressor test load --scenario ./scenarios/api.json
stressor test load --scenario ./scenarios/api.json --vus 20 --duration 1m
stressor test load --scenario api.json --stages '[{"duration":"30s","target":10},{"duration":"1m","target":50}]'
stressor test load --scenario '{"executor":"constant-vus","vus":10,"duration":"30s"}' --name "Smoke Test"
stressor test load --scenario api.json --output csv --output-file results.csv
stressor test load --scenario api.json --config load-config.yaml

Opciones:

  • --scenario <path> - Ruta al archivo de escenario o JSON inline (requerido)
  • --vus <number> - Usuarios virtuales (default: 10)
  • --iterations <number> - Iteraciones totales (default: 100)
  • --duration <duration> - Duración del test (ej: "30s", "1m", "5m30s")
  • --stages <stages> - Definición de stages como JSON string
  • --name <name> - Sobrescribir nombre del test
  • --description <text> - Descripción del test
  • --tags <tags> - Tags como lista separada por comas
  • --thresholds <thresholds> - Thresholds como JSON string
  • --config <path> - Archivo de configuración adicional para merge
  • -o, --output <format> - Formato de salida (json, yaml, table, csv)
  • --output-file <path> - Escribir salida a archivo
  • --verbose - Habilitar logging detallado
  • --silent - Suprimir todo output excepto errores

⚙️ Configuración

Archivo de configuración (YAML/JSON)

# config.yaml
id: mi-test-produccion
name: "Prueba API Ecommerce"
owner: "equipo-qa"
description: "Prueba de carga para API principal"

# Configuración de carga
load:
  scenario:
    executor: ramping-vus
    steps: 
      request: 
        url: "https://mi-ecommerce.com/api"
    stages:
      - duration: "30s"
        target: 10
      - duration: "1m"
        target: 50
      - duration: "30s"
        target: 0
  options:
    vus: 50
    thresholds:
      http_req_duration: ["p(95)<500"]
      http_req_failed: ["rate<0.01"]

# Configuración de auditoría
audit:
  url: "https://mi-ecommerce.com"
  categories:
    - performance
    - seo
  settings:
    formFactor: "desktop"

# Opciones globales
options:
  runInParallel: false
  timeout: 300000
  saveRaw: true

Formatos de Salida

Tabla (default)

stressor run -c config.yaml --output table
Key                | Value
-------------------|-----------------------------
Test Name          | Prueba API Ecommerce
Status             | COMPLETED
Duration           | 65.23s
Total Requests     | 12500
Avg Response Time  | 245.12 ms
Success Rate       | 99.8%

JSON

stressor run -c config.yaml --output json
{
  "testName": "Prueba API Ecommerce",
  "status": "COMPLETED",
  "duration": 65.23,
  "metrics": {
    "totalRequests": 12500,
    "avgResponseTime": 245.12,
    "successRate": 0.998
  }
}

YAML

stressor run -c config.yaml --output yaml
testName: Prueba API Ecommerce
status: COMPLETED
duration: 65.23
metrics:
  totalRequests: 12500
  avgResponseTime: 245.12
  successRate: 0.998

CSV

stressor test load --scenario api.json --output csv --output-file results.csv

🔧 Opciones Globales

  • --verbose - Habilitar logging detallado
  • --silent - Suprimir todo output excepto errores
  • --version - Mostrar versión
  • -h, --help - Mostrar ayuda

Docker

Para integración en docker, aquí hay un ejemplo:

FROM node:18-alpine

RUN npm install -g stressor-cli

WORKDIR /app

COPY scenarios/ ./scenarios/
COPY config.yaml .

ENTRYPOINT ["stressor"]
docker build -t stressor-cli .
docker run -v $(pwd)/results:/app/results stressor-cli run -c config.yaml --output-file /app/results/report.json