0.0.20 • Published 10 months ago

ltrl-http v0.0.20

Weekly downloads
-
License
MIT
Repository
github
Last release
10 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

10 months ago

0.0.18

11 months ago

0.0.19

11 months ago

0.0.17

11 months ago

0.0.14

11 months ago

0.0.13

11 months ago

0.0.12

11 months ago