consume-http-header

JSON →
library 1.0.0 ·javascript
verified Jun 4, 2026

Consume an HTTP request or response stream until all headers have been read, leaving the stream ready to consume the body from the start. Version 1.0.0 is stable with a simple callback-based API. It parses headers from a TCP stream (e.g., net.Socket) and returns the parsed headers object. Lightweight, no dependencies, and focused solely on header consumption without handling chunked transfer encoding or body parsing. Alternatives like `http-parser-js` provide more complete parsing but are heavier.