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

api-performance-test

v1.0.2

Published

A powerful and flexible API load testing tool with parallel and sequential testing capabilities

Readme

api-performance-test

A powerful and flexible API load testing tool that enables developers to perform comprehensive performance testing of their APIs. Features include parallel request execution, sequential series testing, detailed performance metrics, real-time logging, and memory/CPU usage monitoring. Perfect for testing API endpoints under various load conditions and ensuring optimal performance.

Features

  • Parallel request execution
  • Sequential series testing
  • Detailed performance metrics
  • Real-time logging
  • Memory and CPU usage monitoring
  • Support for both HTTP and HTTPS requests
  • Customizable request headers and body
  • Comprehensive debug logging

Installation

npm install api-performance-test

Quick Start

  1. Create a new file (e.g., test.js) and import the testing function:
import runBatchesInParallelSeries from 'api-performance-test';

// Define your API requests
const batchRequests = [
    { 
        url: 'http://your-api.com/endpoint1', 
        method: 'POST',
        headers: { 'Authorization': 'Bearer your-token' },
        data: { key: 'value' }
    },
    { 
        url: 'http://your-api.com/endpoint2', 
        method: 'GET',
        headers: { 'Content-Type': 'application/json' }
    }
];

// Configure the test
const requestConfig = {
    parallelBatchCount: 4,  // Number of parallel batches
    seriesCount: 7,         // Number of times to repeat the parallel execution
    writeDebugLog: true     // Enable detailed logging
};

// Configure debug logging
const debugConfig = {
    requestBody: true,      // Log request body
    responseBody: true,     // Log response body
    requestHeader: true,    // Log request headers
    responseHeader: true    // Log response headers
};

// Run the test
runBatchesInParallelSeries(batchRequests, requestConfig, debugConfig);

Configuration Options

Request Configuration (requestConfig)

const requestConfig = {
    parallelBatchCount: 4,  // Number of parallel batches to run
    seriesCount: 7,         // Number of times to repeat the parallel execution
    writeDebugLog: true     // Enable/disable debug logging
};

Debug Configuration (debugConfig)

const debugConfig = {
    requestBody: true,      // Log request body
    responseBody: true,     // Log response body
    requestHeader: true,    // Log request headers
    responseHeader: true    // Log response headers
};

Example Use Cases

1. Basic API Testing

import runBatchesInParallelSeries from 'api-performance-test';

const batchRequests = [
    { 
        url: 'http://api.example.com/users', 
        method: 'GET'
    }
];

const requestConfig = {
    parallelBatchCount: 5,
    seriesCount: 3,
    writeDebugLog: true
};

runBatchesInParallelSeries(batchRequests, requestConfig);

2. Complex API Testing with Multiple Endpoints

import runBatchesInParallelSeries from 'api-performance-test';

const batchRequests = [
    { 
        url: 'http://api.example.com/users',
        method: 'POST',
        headers: { 'Authorization': 'Bearer token123' },
        data: { name: 'John Doe', email: '[email protected]' }
    },
    { 
        url: 'http://api.example.com/orders',
        method: 'GET',
        headers: { 'Authorization': 'Bearer token123' }
    },
    { 
        url: 'http://api.example.com/products',
        method: 'GET'
    }
];

const requestConfig = {
    parallelBatchCount: 10,
    seriesCount: 5,
    writeDebugLog: true
};

const debugConfig = {
    requestBody: true,
    responseBody: true,
    requestHeader: true,
    responseHeader: true
};

runBatchesInParallelSeries(batchRequests, requestConfig, debugConfig);

Logging

The tool generates detailed logs in the following format:

  • File name: PT_Test_YYYYMMDD-HHMMSS.log
  • Includes:
    • Request and response details
    • Performance metrics
    • Memory usage
    • CPU statistics
    • Success/failure counts
    • Timing information

Performance Metrics

The tool provides real-time monitoring of:

  • Memory usage (heap, RSS, external)
  • CPU usage (user and system time)
  • Request latency
  • Success/failure rates
  • Total execution time

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Author

Bhupendra M.