@koziolek/http-status-as-type
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

@koziolek/http-status-as-type

A simple, lightweight JavaScript/TypeScript library that provides HTTP status codes as types and a handy dictionary with their descriptions.

Installation

npm install @koziolek/http-status-as-type

Usage

JavaScript

const {statusTexts} = require('@koziolek/http-status-as-type');

console.log(statusTexts[200]); // "OK"

TypeScript

import { statusTexts, HttpStatus } from '@koziolek/http-status-as-type';

function printStatus(status: HttpStatus) {
	console.log(statusTexts[status]); // "OK"
}

Available status codes

All official status codes are supported.

(Feel free to extend the list as needed!)

Development

To build the project:

npm run build

To run tests:

npm test

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @koziolek/http-status-as-type

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

15.6 kB

Total Files

13

Last publish

Collaborators

  • koziolek