🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

http-status-codes-minimal

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status-codes-minimal

Constants that represent various HTTP status codes, inspired by the Java Apache HttpStatus API.

1.1.15
latest
Source
npm
Version published
Weekly downloads
262
24.76%
Maintainers
1
Weekly downloads
 
Created
Source

HTTP Status Codes Minimal

Light weight package to managing HTTP status codes and reason phrases in TypeScript and Javascript applications.

✨ Features

  • Comprehensive yet Compact: Get access to a complete range of HTTP status codes and reason phrases without the bloat.
  • TypeScript Ready: Crafted with TypeScript for TypeScript, ensuring you benefit from type safety and autocompletion without sacrificing performance.
  • Feather-Light Footprint: At just 30KB, it's designed to be incredibly efficient, making it a no-brainer addition to your project.
  • User-Friendly: Simplified API with functions like getReasonPhrase and getStatusCode to effortlessly convert between status codes and reason phrases.

📦 Installation

npm install http-status-codes-minimal

Usage

import {
  StatusCodes,
  ReasonPhrases,
  getReasonPhrase,
  getStatusCode,
} from "http-status-codes-minimal";

console.log(StatusCodes.ACCEPTED);
console.log(ReasonPhrases.ACCEPTED);
console.log(getStatusCode("ACCEPTED"));
console.log(getReasonPhrase(202));

HTTP Status Codes and Reason Phrases

CodeConstantReason Phrase
100CONTINUEContinue
101SWITCHING_PROTOCOLSSwitching Protocols
102PROCESSINGProcessing
103EARLY_HINTSEarly Hints
200OKOK
201CREATEDCreated
202ACCEPTEDAccepted
203NON_AUTHORITATIVE_INFORMATIONNon-Authoritative Information
204NO_CONTENTNo Content
205RESET_CONTENTReset Content
206PARTIAL_CONTENTPartial Content
207MULTI_STATUSMulti-Status
300MULTIPLE_CHOICESMultiple Choices
301MOVED_PERMANENTLYMoved Permanently
302FOUNDFound
303SEE_OTHERSee Other
304NOT_MODIFIEDNot Modified
305USE_PROXYUse Proxy
307TEMPORARY_REDIRECTTemporary Redirect
308PERMANENT_REDIRECTPermanent Redirect
400BAD_REQUESTBad Request
401UNAUTHORIZEDUnauthorized
402PAYMENT_REQUIREDPayment Required
403FORBIDDENForbidden
404NOT_FOUNDNot Found
405METHOD_NOT_ALLOWEDMethod Not Allowed
406NOT_ACCEPTABLENot Acceptable
407PROXY_AUTHENTICATION_REQUIREDProxy Authentication Required
408REQUEST_TIMEOUTRequest Timeout
409CONFLICTConflict
410GONEGone
411LENGTH_REQUIREDLength Required
412PRECONDITION_FAILEDPrecondition Failed
413PAYLOAD_TOO_LARGEPayload Too Large
414URI_TOO_LONGURI Too Long
415UNSUPPORTED_MEDIA_TYPEUnsupported Media Type
416RANGE_NOT_SATISFIABLERange Not Satisfiable
417EXPECTATION_FAILEDExpectation Failed
418IM_A_TEAPOTI'm a Teapot
419INSUFFICIENT_SPACE_ON_RESOURCEInsufficient Space on Resource
420METHOD_FAILUREMethod Failure
421MISDIRECTED_REQUESTMisdirected Request
422UNPROCESSABLE_ENTITYUnprocessable Entity
423LOCKEDLocked
424FAILED_DEPENDENCYFailed Dependency
426UPGRADE_REQUIREDUpgrade Required
428PRECONDITION_REQUIREDPrecondition Required
429TOO_MANY_REQUESTSToo Many Requests
431REQUEST_HEADER_FIELDS_TOO_LARGERequest Header Fields Too Large
451UNAVAILABLE_FOR_LEGAL_REASONSUnavailable For Legal Reasons
500INTERNAL_SERVER_ERRORInternal Server Error
501NOT_IMPLEMENTEDNot Implemented
502BAD_GATEWAYBad Gateway
503SERVICE_UNAVAILABLEService Unavailable
504GATEWAY_TIMEOUTGateway Timeout
505HTTP_VERSION_NOT_SUPPORTEDHTTP Version Not Supported
507INSUFFICIENT_STORAGEInsufficient Storage
511NETWORK_AUTHENTICATION_REQUIREDNetwork Authentication Required

Keywords

http

FAQs

Package last updated on 16 Mar 2024

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