Skip to content

Translates http status code to friendly object containing description and emoji

License

Notifications You must be signed in to change notification settings

harshzalavadiya/friendly-http-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Translates http status code to friendly object containing description and emoji

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published