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

stress-http-tester

v1.0.3

Published

Simple HTTP stress test library for Node.js

Readme

Stress HTTP Tester

🚀 Stress HTTP Tester es una herramienta ligera para realizar pruebas de estrés a APIs HTTP desde Node.js. Permite enviar múltiples peticiones concurrentes a un endpoint, validar respuestas y medir el rendimiento del servidor.

Puede usarse como:

  • CLI (herramienta de terminal)
  • Librería dentro de proyectos Node.js

Es ideal para:

  • Pruebas de carga de APIs
  • Medición de rendimiento
  • Validación automática de respuestas
  • Detectar endpoints lentos
  • Pruebas antes de despliegues en producción

Características

  • Enviar miles de peticiones HTTP
  • Configurar concurrencia
  • Validar código de estado HTTP
  • Validar estructura de respuesta
  • Generar valores aleatorios en payload
  • Mostrar barra de progreso en consola
  • Usar mediante CLI o como librería
  • Configuración mediante JSON

Instalación

Ejecutar directamente con npx

npx stress-http-tester test.json

Instalar globalmente

npm install -g stress-http-tester

Luego ejecutar:

stress-http-tester test.json

Instalar como librería

npm install stress-http-tester

Uso desde la terminal (CLI)

Ejemplo:

stress-http-tester config.json
stress-http-tester test.json

Archivo de configuración

Debes crear un archivo JSON con la configuración del test.

Ejemplo test.json:

{
  "url": "http://localhost:3000/api/test",
  "method": "POST",
  "requests": 100,
  "concurrency": 10,
  "headers": {
    "Content-Type": "application/json"
  },
  "payload": {
    "email": "test<random>@mail.com"
  },
  "expectedStatus": 200,
  "expectedBody": {
    "success": true
  }
}

Opciones de configuración

| Opción | Descripción | | -------------- | ------------------------------------ | | url | Endpoint de la API | | method | Método HTTP (GET, POST, PUT, DELETE) | | requests | Número total de peticiones | | concurrency | Número de peticiones concurrentes, simula varios usuarios al tiempo | | headers | Encabezados HTTP | | payload | Cuerpo de la petición | | expectedStatus | Código HTTP esperado | | expectedBody | Estructura esperada de la respuesta |


Valores aleatorios en el payload

Puedes usar el texto <random> dentro del payload.

Ejemplo:

{
  "email": "usuario<random>@correo.com"
}

Cada petición reemplazará <random> por un número diferente.

Ejemplo generado:

[email protected]
[email protected]
[email protected]

Esto es útil para evitar datos duplicados en APIs.


Ejemplo de salida en consola

STRESS HTTP TESTER

**************************************************
   _____ _______ _____  ______ _____ _____
  / ____|__   __|  __ \|  ____/ ____/ ____|
 | (___    | |  | |__) | |__ | (___| (___
  \___ \   | |  |  _  /|  __| \___ \\___ \
  ____) |  | |  | | \ \| |____ ____)|___) |
 |_____/   |_|  |_|  \_\______|_____/_____/

           STRESS HTTP TESTER TOOL
             BY JOHN CASTIBLANCO
**************************************************

Iniciando prueba de estrés...

Progreso |████████████░░░░░░| 60% || 600/1000 Requests

RESULTADOS

Exitosas: 980
Fallidas: 20
Tiempo promedio: 120 ms
Requests por segundo (RPS): 850
Detalle:
{
  "exitosas": 0,
  "fallidas": 100,
  "tiempo_promedio_ms": 12520,
  "criterio_exito": {
    "status_esperado": 200,
    "body_esperado_base": {
      "success": true
    }
  },
  "resumen_peticiones": [
    {
      "numero": 1,
      "status": 200,
      "tiempo_ms": 161,
      "exito": false,
      "motivo": "expectedBody dont Match"
    },
    {
      "numero": 2,
      "status": 200,
      "tiempo_ms": 138,
      "exito": false,
      "motivo": "expectedBody dont Match"
    }...
  ]

Uso como librería

También puedes usar Stress HTTP Tester dentro de un proyecto Node.js.

const { stressTest } = require("stress-http-tester");

(async () => {

  const resultado = await stressTest({
    url: "http://localhost:3000/api/test",
    method: "POST",
    requests: 100,
    concurrency: 10,
    payload: {
      email: "test<random>@mail.com"
    },
    expectedStatus: 200,
    expectedBody: {
        state: 'ok'
    }
  });

  response.json(resultado)

})();

Ejemplo de resultado

{
    "exitosas": 100,
    "fallidas": 0,
    "tiempo_promedio_ms": 122.24,
    "criterio_exito": {
        "status_esperado": 200,
        "body_esperado_base": {
            "state": "ok"
        }
    },
    "resumen_peticiones": [
        {
            "numero": 1,
            "status": 200,
            "tiempo_ms": 167,
            "exito": true,
            "motivo": null
        },
        {
            "numero": 2,
            "status": 200,
            "tiempo_ms": 143,
            "exito": true,
            "motivo": null
        }...
    ]
}

Recomendaciones de rendimiento

Para pruebas de carga más altas:

  • Aumentar la concurrencia
  • Evitar guardar logs de todas las peticiones

Contribuciones

Las contribuciones son bienvenidas. Si encuentras un error o deseas proponer una mejora, puedes abrir un issue o enviar un pull request.

❤️ Apoya el proyecto

Si stress-http-tester te ayudó a probar tus APIs puedes apoyar su desarrollo.

Donar con MercadoPago

Licencia

Uso personal y educativo únicamente. El uso comercial requiere autorización del autor. Ver archivo LICENSE para más información.

Autor