GitHunt
HA

harshzalavadiya/friendly-http-status

Translates http status code to friendly object containing description and emoji

Friendly HTTP Status

Translates HTTP status code to minimal friendly object containing description and emoji ๐Ÿ˜ƒ

GitHub Actions Status
NPM
gzip

๐Ÿ”ง Installation

npm i friendly-http-status

๐Ÿ“ฆ Usage

import { getFriendlyError } from "friendly-http-status";

console.log(getFriendlyError(404));

๐Ÿ‘€ Response

getFriendlyError always returns json object with following property even if code unknown it will return unknown error object

{
  "emoji": "โ“",
  "message": "Not Found",
  "description": "The requested page could not be found but may be available again in the future."
}

๐Ÿค  Credits

Languages

TypeScript100.0%

Contributors

MIT License
Created October 13, 2019
Updated March 7, 2023
harshzalavadiya/friendly-http-status | GitHunt