JSPM

@normality/status-code

4.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q34226F
  • License MIT

HTTP status codes utility.

Package Exports

  • @normality/status-code
  • @normality/status-code/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@normality/status-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

StatusCode

npm npm npm

Enums and utilities around status codes.

Requirements

  • node >= 8.6, tested with:
  • node@8.6.0
  • node@12.8.1
  • typescript >= 4.0, tested with:
  • typescript@4.0.2

Installation

npm i @normality/status-code

Usage

import { StatusCode, isStatusCode, is5xx } from '@normality/status-code';

StatusCode.OK; // 200
isStatusCode(200); // true
is5xx(StatusCode.INTERNAL_SERVER_ERROR); // true