This is the technical documentation for @panmdaa/server, a zero-dependency TypeScript HTTP/WebSocket server library.
Every document here explains what a subsystem does, why it was designed that way, how it works internally, and when each code path runs.
Using the library → start in Usage. Understanding the library → start with the architecture overview. Each document links to the relevant source files with file:line references.
| Topic | Document |
|---|---|
| Using the library, guides, best practices | Usage |
| Big picture, module map, design philosophy | Architecture overview |
| Why the code looks the way it does | Design decisions |
| Routing engine (RadixTree, params, wildcards) | Router |
| Route precedence and matching order | Router matching & precedence |
| HTTP request lifecycle | HTTP lifecycle |
Middleware compilation (compileHandler) |
Handler compilation |
| Handler contexts (request surface) | Context |
| Response surface | Response |
| Body parsing | Body |
| Error handling | Errors |
| WebSocket handshake & upgrade | WebSocket lifecycle |
| Frame parsing & unmasking | Frames |
| Connection state machine | Connection |
| permessage-deflate compression | Compression |
| Heartbeat | Heartbeat |
| HTTP/2 (streams & extended CONNECT) | HTTP/2 |
| Built-in middleware | Middleware |
| Testing | Testing |
| Benchmarks | Benchmarking |
| npm scripts and tooling | Development |
file:linereferences point at the currentsrc/layout.- "Fast path" means the code that runs for the common case (no query string, static route, small payload, no compression).
- Performance claims that come from measured benchmarks are tagged
[bench]and cross-referenced in Benchmarking.