New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@pdc/http-status-codes

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pdc/http-status-codes

An organized collection of meaningfully named HTTP status code constants

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
2
Created
Source

HTTP Status Codes

This simple package provides an organized collection of meaningfully named HTTP status code constants.

Installation

npm install http-status-codes

Usage

Import the enums and use them in your code for clarity and type safety:

import { HTTP_STATUS } from "http-status-codes-enum";

if (response.status === HTTP_STATUS.SUCCESSFUL.OK) {
	// handle success
}

if (response.status === HTTP_STATUS.CLIENT_ERROR.NOT_FOUND) {
	// handle 404
}

Status Code Groups

  • INFORMATIONAL: 1xx codes (e.g., CONTINUE, PROCESSING)
  • SUCCESSFUL: 2xx codes (e.g., OK, CREATED)
  • REDIRECTION: 3xx codes (e.g., MOVED_PERMANENTLY, FOUND)
  • CLIENT_ERROR: 4xx codes (e.g., BAD_REQUEST, NOT_FOUND)
  • SERVER_ERROR: 5xx codes (e.g., INTERNAL_SERVER_ERROR, SERVICE_UNAVAILABLE)

API

All status codes are available as enums under the HTTP_STATUS object. Example:

HTTP_STATUS.SUCCESSFUL.CREATED; // 201
HTTP_STATUS.CLIENT_ERROR.FORBIDDEN; // 403

FAQs

Package last updated on 10 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts