Skip to content

codevor/js-http-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

JS HTTP Status

Travis CI Coverage Status NPM Version NPM Downloads Commitizen License

A simple way to catch HTTP statuses with JavaScript.

Installation

js-http-status is available on npm/yarn:

$ npm install @codevor/js-http-status --save
$ yarn add @codevor/js-http-status

Documentation

Access documentation clicking here.

Usage

Practice and learn here.

With ES6/import

import {
  findStatusByCode,
  findStatusByKey,
  isCreated,
  isOk
} from 'js-http-status';

findStatusByCode(200);
// => { code: 200, key: 'OK', message: 'OK', category: 'SUCCESS' }

findStatusByKey('TOO_MANY_REQUESTS');
// => { code: 429, key: 'TOO_MANY_REQUESTS', message: 'Too Many Requests', category: 'CLIENT_ERROR' }

isCreated(201); // => true
isCreated(500); // => HTTPStatusError: Expected a 201 response.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Changelog

This project adheres to Semantic Versioning. Every release, along with the migration instructions, is documented on the Github Releases page.

Bugs and Sugestions

Report bugs or do suggestions using the issues.

References

License

MIT License ยฉ Codevor

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy