Popsicle Status Middleware
JSON →Popsicle Status is a middleware for the `popsicle` HTTP client library, designed to automatically reject HTTP responses with undesirable status codes. It provides a simple function, `status(min?: number, max?: number)`, which returns a middleware that validates a response's status code against a specified inclusive `min` and exclusive `max` range. By default, it rejects any status outside the 200-399 range (i.e., anything not a 2xx or 3xx success/redirection code). The current stable version is `3.0.0`. This library is actively maintained, with releases primarily aligning with major updates to its peer dependencies, `popsicle` and `servie`, to ensure compatibility. Its key differentiator is its seamless integration into the `popsicle` middleware chain, simplifying error handling by transforming invalid HTTP responses into thrown errors, making control flow clearer than manual status checks.
Traffic · last 30 days ↓33% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇫🇷 France · NP