snapreq
JSON →snapreq is a cross-platform HTTP and WebSocket client with a single API across Node.js, web browsers, Expo, and React Native. Current stable version 0.0.5. It picks the right transport (Node http/https, fetch, or XMLHttpRequest) at runtime and zero runtime dependencies. Unlike alternatives (ky, got, node-fetch), snapreq enforces API consistency by raising SnapReqUnsupportedFeatureError for platform-specific gaps (e.g., Unix sockets in browsers) instead of silently changing behavior. ESM-only with JSDoc types checked by tsc. No barrel entry point; imports from subpaths to enable tree-shaking. Supports retry, timeouts, Unix sockets, TLS configuration, request cancellation, streaming, and automatic JSON parsing.
Resources
packagesnapreq ↗