0.0.20 • Published 7 months ago

ltrl-http v0.0.20

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

ltrl-http

🍱 Literal HTTP codes & statuses.

 Release Notes

Getting Started

  1. Install the module
pnpm add ltrl-http
  1. Start using HTTP codes
import { status } from "ltrl-http";

status.OK; // 200
status.FORBIDDEN; // 401
status.UNAUTHORIZED; // 403
// etc
  1. HTTP status codes are ready to go!

Utils

FunctionDescription
isHTTPCode(code)Check if a given value is a valid HTTP code.
useHTTPCode(code)Resolve a given HTTP code to an HTTP status configuration.
useHTTPCodeConfig()Access the ltrl HTTP code definition.
isHTTPStatus(status)Check if a given value is a valid HTTP status.
useHTTPStatus(status)Exchange an HTTP status for an HTTP code.
useHTTPStatusConfig()Access the ltrl HTTP status definition.

Types

TypeDescription
HTTPCodeA number-literal union type of all available HTTP status codes.
HTTPStatusA string-literal union type of all available HTTP statuses.
HTTPStatusCode<S extends HTTPStatus>Resolve the expected literal HTTP code type of a given HTTP status string;

License

MIT License © 2024-PRESENT Alexander Thorwaldson

0.0.20

7 months ago

0.0.18

8 months ago

0.0.19

8 months ago

0.0.17

8 months ago

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago