Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

friendly-http-status

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

friendly-http-status

Translates http status code to friendly object containing description and emoji

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

Friendly Http Status

Translates http status code to minimal friendly object containing description and emoji 😃

🔧 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

  • Emoji dataset is taken from http-status-extra and stripped to minimal
  • microbundle for packaging
  • TypeScript

FAQs

Package last updated on 13 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc