load-sim
v1.0.2
Published
Lightweight API load simulator CLI
Downloads
288
Maintainers
Readme
🚀 load-sim
load-sim is a lightweight, fast, and customizable CLI tool for API load testing and performance benchmarking. It helps developers simulate high traffic, measure response times, and analyze system performance directly from the terminal.
✨ Features
✔ Concurrent request simulation
✔ Configurable total requests and concurrency
✔ Warm-up request support
✔ Real-time terminal progress bar
✔ Detailed performance metrics
✔ Percentile calculations (P50 / P75 / P90 / P95)
✔ JSON, CSV, and HTML report generation
✔ Custom headers and request body support
✔ Timeout control
📦 Installation
Global install
npm install -g load-simOr use with npx
npx load-sim test🚀 Usage
Basic load test
load-sim test https://example.comCustom requests and concurrency
load-sim test https://example.com --requests 100 --concurrency 20Send JSON body with headers
load-sim test https://example.com/api \
--method POST \
--body '{"name":"test"}' \
--headers '{"Content-Type":"application/json"}'Warm-up run
load-sim test https://example.com --requests 50 --warmup 5📊 Report Types
Text report (default)
load-sim test https://example.comJSON report
load-sim test https://example.com --report jsonCSV export
load-sim test https://example.com --report csvHTML report
load-sim test https://example.com --report htmlCustom output file
load-sim test https://example.com --report html --output report.html📈 Sample Output
--- Load Test Report ---
URL: https://example.com
Total requests (measured): 100
Warm-up ignored: 5
Success: 98
Failures: 2
Min: 120 ms
Max: 980 ms
Avg: 344.5 ms
P50: 310 ms
P75: 420 ms
P90: 650 ms
P95: 890 ms
Test duration: 5020 ms (19.92 req/sec)
Status counts: { '200': 98, '500': 2 }🛠 Tech Stack
Node.js Commander.js Axios p-limit cli-progress
📄 License MIT License
🤝 Contributing Contributions are welcome! Fork the repo, make your changes, and submit a pull request.
💡 Author Usaid GitHub: https://github.com/usaidgithub npm: https://www.npmjs.com/package/load-sim
