Status
🗿 HTTP status utility for Deno. Based on Java Apache HttpStatus
Install / Use
/learn @denosaurs/StatusREADME
status
HTTP codes and status utility for Deno. Based on Java Apache HttpStatus
API
status(code) and status.pretty(code)
import { status } from "https://deno.land/x/status/mod.ts";
status(403); // => "FORBIDDEN"
status("403"); // => "FORBIDDEN"
status.pretty(403); // => "Forbidden"
status(306); // throws
status(message)
import { status } from "https://deno.land/x/status/mod.ts";
status("forbidden"); // => 403
status("FoRbIdDeN"); // => 403
status("foo"); // throws
status.codes
Array of all the possible status codes.
import { status } from "https://deno.land/x/status/mod.ts";
status.codes; // => [202, 502, 400, ...]
status.code[code]
Map of all the available codes. message (string) -> code (number)
import { status } from "https://deno.land/x/status/mod.ts";
status.code; // => { "ACCEPTED": 202, "BAD_GATEWAY": 502, "BAD_REQUEST": 400, ... }
status.code["FORBIDDEN"] = 403;
status.message[msg]
Map of all the available codes. code (number) -> message (string)
import { status } from "https://deno.land/x/status/mod.ts";
status.message; // => { 202: "ACCEPTED", 502: "BAD_GATEWAY, 400: "BAD_REQUEST", ... }
status.message[403] = "FORBIDDEN";
status.empty[code]
Returns true if a status code expects an empty body.
import { status } from "https://deno.land/x/status/mod.ts";
status.empty[200]; // => undefined
status.empty[204]; // => true
status.redirect[code]
Returns true if a status code is a valid redirect status.
import { status } from "https://deno.land/x/status/mod.ts";
status.redirect[200]; // => undefined
status.redirect[301]; // => true
status.retry[code]
Returns true if a status code hints that the request might be retried.
import { status } from "https://deno.land/x/status/mod.ts";
status.retry[501]; // => undefined
status.retry[503]; // => true
other
contribution
Pull request and issues are very welcome. Code style is formatted with
deno fmt.
inspiration
The project is inspired by the statuses project.
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
