@normality/status-code
v4.0.4
Published
HTTP status codes utility.
Downloads
7
Maintainers
Readme
StatusCode
Enums and utilities around status codes.
Requirements
node >= 8.6
, tested with:[email protected]
[email protected]
typescript >= 4.0
, tested with:[email protected]
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