1.1.15 • Published 2 months ago

http-status-codes-minimal v1.1.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

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
1.1.15

2 months ago

1.1.14

2 months ago

1.1.13

2 months ago

1.1.12

2 months ago

1.1.11

2 months ago

1.1.10

2 months ago

1.1.9

2 months ago

1.1.8

2 months ago

1.1.7

2 months ago

1.1.6

2 months ago

1.1.5

2 months ago

1.1.4

2 months ago

1.1.3

2 months ago

1.1.2

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago