error-to-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

error-to-text

A small and simple package that converts http error codes to a user-friendly text so your users can understand problems on your server.

Usage

Call:

import toText from "error-to-text";

const error = toText(404);

console.log(error.title); // -> Not Found

Return Object:

{
    code: number,
    title: string,
    description:string
} | undefined

Readme

Keywords

none

Package Sidebar

Install

npm i error-to-text

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

16.3 kB

Total Files

7

Last publish

Collaborators

  • nudelsuppe42