serve-once

JSON →
library 3.0.2 ·javascript
verified May 27, 2026

A utility for testing Express middleware by serving exactly one HTTP request then closing the server. It creates an HTTP server on a free port, runs the middleware, serves one request, and resolves with the response body. The current stable version is 3.0.2, released in early 2024. It supports GET, POST, PUT, DELETE, HEAD, and other methods. The package was rewritten in v3 to remove node-fetch dependency and requires Node >=18. It returns responses as string, JSON, buffer, or stream. It is lightweight and similar to supertest but simpler and focused on single-request testing.

total hits 26
actors 8 distinct systems
last hit 1d ago AhrefsBot
ByteDance
7
GPTBot
5
MetaBot
4
Script
1
ClaudeBot
1
Humans
2

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇩🇪 Germany · ZA