Translates http status code to friendly object containing description and emoji
npm install friendly-http-statusTranslates http status code to minimal friendly object containing description and emoji 😃
``sh`
npm i friendly-http-status
`javascript
import { getFriendlyError } from "friendly-http-status";
console.log(getFriendlyError(404));
`
getFriendlyError always returns json object with following property even if code unknown it will return unknown error object
`json``
{
"emoji": "❓",
"message": "Not Found",
"description": "The requested page could not be found but may be available again in the future."
}
- Emoji dataset is taken from http-status-extra and stripped to minimal
- microbundle for packaging
- TypeScript