@codevor/js-http-status

1.1.2 • Public • Published

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

Package Sidebar

Install

npm i @codevor/js-http-status

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

35.6 kB

Total Files

7

Last publish

Collaborators

  • helderberto
  • helderburato
  • caiangums