Skip to main content

http-status is a lightweight library providing HTTP status code enumerations for TypeScript and JavaScript projects.

This package works with Bun, Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
70%
Published
2 months ago (1.0.0)

http-status

http-status is a lightweight library providing HTTP status code enumerations for TypeScript and JavaScript projects. It is designed to offer a simple, intuitive, and type-safe way to handle HTTP status codes, enhancing code readability and maintainability.

Usage Example

Here’s how you can use the http-status package in your projects:

import { HttpStatus } from "./status";

function handler(request) {
  return new Response("Hello world!", {
    status: HttpStatus.OK,
    statusText: HttpStatus.OKText,
  });
}

Add Package

deno add @gizmo/http-status

Import symbol

import * as mod from "@gizmo/http-status";

Add Package

npx jsr add @gizmo/http-status

Import symbol

import * as mod from "@gizmo/http-status";

Add Package

yarn dlx jsr add @gizmo/http-status

Import symbol

import * as mod from "@gizmo/http-status";

Add Package

pnpm dlx jsr add @gizmo/http-status

Import symbol

import * as mod from "@gizmo/http-status";

Add Package

bunx jsr add @gizmo/http-status

Import symbol

import * as mod from "@gizmo/http-status";