Gathering detailed insights and metrics for http-response-status-code
Gathering detailed insights and metrics for http-response-status-code
Gathering detailed insights and metrics for http-response-status-code
Gathering detailed insights and metrics for http-response-status-code
All HTTP Status Codes from Wikipedia - List of HTTP status codes
npm install http-response-status-code
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
127 Commits
1 Forks
2 Watchers
7 Branches
1 Contributors
Updated on Mar 23, 2025
Latest Version
1.7.5
Package Id
http-response-status-code@1.7.5
Unpacked Size
105.40 kB
Size
17.32 kB
File Count
29
NPM Version
10.8.2
Node Version
20.18.0
Published on
Feb 18, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
All HTTP Status Codes from Wikipedia - List of HTTP status codes
1npm install http-response-status-code
1var STATUS_CODES = require('http-response-status-code'); 2// OR 3import * as STATUS_CODES from 'http-response-status-code'; 4// OR 5import { OK, getStatusName, CODES } from 'http-response-status-code'; 6 7console.log(STATUS_CODES.getStatusName(STATUS_CODES.OK)); 8// OK 9 10console.log(getStatusName(OK)); 11// OK 12 13console.log(OK); 14// 200 15 16console.log(STATUS_CODES.getStatusDescription(STATUS_CODES.INTERNAL_SERVER_ERROR)); 17// Internal Server Error 18 19console.log(STATUS_CODES.getStatusCode("IM_A_TEAPOT")); 20// 418 21 22console.log(STATUS_CODES.CODES.HTTP_CODE_200); 23// 200 24 25res.status(STATUS_CODES.INTERNAL_SERVER_ERROR).end() 26// OR 27res.status(STATUS_CODES.CODES.HTTP_CODE_500).end() 28 29 30res.status(STATUS_CODES.BAD_REQUEST).send(STATUS_CODES.getStatusDescription(STATUS_CODES.BAD_REQUEST)); 31// OR 32res.status(STATUS_CODES.CODES.HTTP_CODE_400).send(STATUS_CODES.getStatusDescription(STATUS_CODES.CODES.HTTP_CODE_400)); 33 34res.status(STATUS_CODES.getStatusCode("NOT_FOUND")).sendFile('/absolute/path/to/404.png'); 35// OR 36res.status(STATUS_CODES.CODES.HTTP_CODE_404).sendFile('/absolute/path/to/404.png');
Returns the HTTP status code from status code name.
name
(String
): The name of the status code (e.g., "IM_A_TEAPOT"
).code
(number
): The code number of the status if code exists.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getStatusCode("IM_A_TEAPOT")); // 418
Returns the HTTP status code name from status code (e.g., 418
).
code
(number
): The code number of the status (e.g., 418
).name
(String
): The name of the status code if name exists.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getStatusName(418)); // "IM_A_TEAPOT"
Returns the status description from HTTP status code (e.g., 418
).
code
(number
): The code number of the status (e.g., 418
).name
(String
): The description of the status code if code exists.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getStatusDescription(500)); // "Internal Server Error"
Determines whether the specified status code represents an informational status.
code
(number
): The code number of the status (e.g., 100
).isInformational
(boolean
): Returns true
if the status code represents a informational status code (1xx), otherwise returns false
.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.isInformational(100)); // True 3console.log(STATUS_CODES.isInformational(200)); // False
Provides a list of all the informational HTTP status codes.
result
(number[]
): An array of all the informational HTTP status codes.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getInformationalCodes()); // [100, 101, ...]
Determines whether the specified status code represents a success status.
code
(number
): The code number of the status (e.g., 200
).isSuccess
(boolean
): Returns true
if the status code represents a success status code (2xx), otherwise returns false
.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.isSuccess(200)); // True 3console.log(STATUS_CODES.isSuccess(100)); // False
Provides a list of all the success HTTP status codes.
result
(number[]
): An array of all the success HTTP status codes.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getSuccessCodes()); // [200, 201, ...]
Determines whether the specified status code represents a redirection status.
code
(number
): The code number of the status (e.g., 300
).isRedirectional
(boolean
): Returns true
if the status code represents a redirection status code (3xx), otherwise returns false
.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.isRedirectional(300)); // True 3console.log(STATUS_CODES.isRedirectional(100)); // False
Provides a list of all the redirection HTTP status codes.
result
(number[]
): An array of all the redirection HTTP status codes.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getRedirectionalCodes()); // [300, 301, ...]
Determines whether the specified status code represents a client side error status.
code
(number
): The code number of the status (e.g., 400
).isClientError
(boolean
): Returns true
if the status code represents a client side error code (4xx), otherwise returns false
.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.isClientError(400)); // True 3console.log(STATUS_CODES.isClientError(100)); // False
Provides a list of all the client side error HTTP status codes.
result
(number[]
): An array of all the client side error HTTP status codes.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getClientErrorCodes()); // [400, 401, ...]
Determines whether the specified status code represents a server side error status.
code
(number
): The code number of the status (e.g., 500
).isServerError
(boolean
): Returns true
if the status code represents a server side error code (5xx), otherwise returns false
.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.isServerError(500)); // True 3console.log(STATUS_CODES.isServerError(100)); // False
Provides a list of all the server side error HTTP status codes.
result
(number[]
): An array of all the server side error HTTP status codes.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.getServerErrorCodes()); // [500, 501, ...]
Validates whether the provided status code is recognized as valid.
code
(number
): The code number of the status (e.g., 500
).isValidStatusCode
(boolean
): Returns true
if the status code represents a valid status code (1xx, 2xx, ..., 5xx), otherwise returns false
.Error
: An error object if something goes wrong, containing details about the issue.1var STATUS_CODES = require('http-response-status-code'); 2console.log(STATUS_CODES.isValidStatusCode(500)); // True 3console.log(STATUS_CODES.isValidStatusCode(999)); // False
Code | Enum | Name | Description |
---|---|---|---|
100 | HTTP_CODE_100 | CONTINUE | Continue |
101 | HTTP_CODE_101 | SWITCHING_PROTOCOLS | Switching Protocols |
102 | HTTP_CODE_102 | PROCESSING | Processing |
103 | HTTP_CODE_103 | EARLY_HINTS | Early Hints |
122 | HTTP_CODE_122 | TOO_LONG | Too Long |
200 | HTTP_CODE_200 | OK | OK |
201 | HTTP_CODE_201 | CREATED | Created |
202 | HTTP_CODE_202 | ACCEPTED | Accepted |
203 | HTTP_CODE_203 | NON_AUTHORITATIVE_INFORMATION | Non Authoritative Information |
204 | HTTP_CODE_204 | NO_CONTENT | No Content |
205 | HTTP_CODE_205 | RESET_CONTENT | Reset Content |
206 | HTTP_CODE_206 | PARTIAL_CONTENT | Partial Content |
207 | HTTP_CODE_207 | MULTI_STATUS | Multi-Status |
208 | HTTP_CODE_208 | ALREADY_REPORTED | Already Reported |
226 | HTTP_CODE_226 | IM_USED | IM Used |
300 | HTTP_CODE_300 | MULTIPLE_CHOICES | Multiple Choices |
301 | HTTP_CODE_301 | MOVED_PERMANENTLY | Moved Permanently |
302 | HTTP_CODE_302 | MOVED_TEMPORARILY | Moved Temporarily |
303 | HTTP_CODE_303 | SEE_OTHER | See Other |
304 | HTTP_CODE_304 | NOT_MODIFIED | Not Modified |
305 | HTTP_CODE_305 | USE_PROXY | Use Proxy |
306 | HTTP_CODE_306 | SWITCH_PROXY | Switch Proxy |
307 | HTTP_CODE_307 | TEMPORARY_REDIRECT | Temporary Redirect |
308 | HTTP_CODE_308 | PERMANENT_REDIRECT | Permanent Redirect |
400 | HTTP_CODE_400 | BAD_REQUEST | Bad Request |
401 | HTTP_CODE_401 | UNAUTHORIZED | Unauthorized |
402 | HTTP_CODE_402 | PAYMENT_REQUIRED | Payment Required |
403 | HTTP_CODE_403 | FORBIDDEN | Forbidden |
404 | HTTP_CODE_404 | NOT_FOUND | Not Found |
405 | HTTP_CODE_405 | METHOD_NOT_ALLOWED | Method Not Allowed |
406 | HTTP_CODE_406 | NOT_ACCEPTABLE | Not Acceptable |
407 | HTTP_CODE_407 | PROXY_AUTHENTICATION_REQUIRED | Proxy Authentication Required |
408 | HTTP_CODE_408 | REQUEST_TIMEOUT | Request Timeout |
409 | HTTP_CODE_409 | CONFLICT | Conflict |
410 | HTTP_CODE_410 | GONE | Gone |
411 | HTTP_CODE_411 | LENGTH_REQUIRED | Length Required |
412 | HTTP_CODE_412 | PRECONDITION_FAILED | Precondition Failed |
413 | HTTP_CODE_413 | REQUEST_TOO_LONG | Request Entity Too Large |
414 | HTTP_CODE_414 | REQUEST_URI_TOO_LONG | Request-URI Too Long |
415 | HTTP_CODE_415 | UNSUPPORTED_MEDIA_TYPE | Unsupported Media Type |
416 | HTTP_CODE_416 | REQUESTED_RANGE_NOT_SATISFIABLE | Requested Range Not Satisfiable |
417 | HTTP_CODE_417 | EXPECTATION_FAILED | Expectation Failed |
418 | HTTP_CODE_418 | IM_A_TEAPOT | I'm a teapot |
419 | HTTP_CODE_419 | INSUFFICIENT_SPACE_ON_RESOURCE | Insufficient Space on Resource |
420 | HTTP_CODE_420 | METHOD_FAILURE | Method Failure |
421 | HTTP_CODE_421 | MISDIRECTED_REQUEST | Misdirected Request |
422 | HTTP_CODE_422 | UNPROCESSABLE_ENTITY | Unprocessable Entity |
423 | HTTP_CODE_423 | LOCKED | Locked |
424 | HTTP_CODE_424 | FAILED_DEPENDENCY | Failed Dependency |
425 | HTTP_CODE_425 | TOO_EARLY | Too Early |
426 | HTTP_CODE_426 | UPGRADE_REQUIRED | Upgrade Required |
428 | HTTP_CODE_428 | PRECONDITION_REQUIRED | Precondition Required |
429 | HTTP_CODE_429 | TOO_MANY_REQUESTS | Too Many Requests |
431 | HTTP_CODE_431 | REQUEST_HEADER_FIELDS_TOO_LARGE | Request Header Fields Too Large |
451 | HTTP_CODE_451 | UNAVAILABLE_FOR_LEGAL_REASONS | Unavailable For Legal Reasons |
500 | HTTP_CODE_500 | INTERNAL_SERVER_ERROR | Internal Server Error |
501 | HTTP_CODE_501 | NOT_IMPLEMENTED | Not Implemented |
502 | HTTP_CODE_502 | BAD_GATEWAY | Bad Gateway |
503 | HTTP_CODE_503 | SERVICE_UNAVAILABLE | Service Unavailable |
504 | HTTP_CODE_504 | GATEWAY_TIMEOUT | Gateway Timeout |
505 | HTTP_CODE_505 | HTTP_VERSION_NOT_SUPPORTED | HTTP Version Not Supported |
506 | HTTP_CODE_506 | VARIANT_ALSO_NEGOTIATES | Variant Also Negotiates |
507 | HTTP_CODE_507 | INSUFFICIENT_STORAGE | Insufficient Storage |
508 | HTTP_CODE_508 | LOOP_DETECTED | Loop Detected |
510 | HTTP_CODE_510 | NOT_EXTENDED | Not Extended |
511 | HTTP_CODE_511 | NETWORK_AUTHENTICATION_REQUIRED | Network Authentication Required |
The original author of the project is Himanshu Bansal
This is all voluntary work, so if you want to support my efforts you can
You can also use the following:
http-response-status-code
project is open-sourced software licensed under the MIT license by Himanshu Bansal.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
security policy file detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More