@zcorky/statuses
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

statuses

NPM version Coverage Status Dependencies Build Status license issues

Install

$ npm install @zcorky/statuses

Usage

// see more in test
// typescript
import status, { isRedirect, isEmpty, isRetry } from '@zcorky/statuses';

// status
status(403) // => 403
status('403') // => 403
status('Forbidden') // => 403
status(306) // throws, as it's not supported by node.js

// status codes for redirects
// 300, 301, 302, 303, 305, 307, 308
isRedirect(300); // => true

// status codes for empty bodies
// 204, 205, 304
isEmpty(204); // => true

// status codes for when you should retry the request
// 502, 503, 504
isRetry(502); // => true 

Relatived

  • statuses - HTTP status utility for node.

License

MIT © Moeover

Readme

Keywords

none

Package Sidebar

Install

npm i @zcorky/statuses

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

6.09 kB

Total Files

5

Last publish

Collaborators

  • uniquecolesmith