JSPM

http-status-code-const-enum

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 160
  • Score
    100M100P100Q84755F
  • License MIT

Basic const enum declaration for HTTP status codes

Package Exports

  • http-status-code-const-enum

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 (http-status-code-const-enum) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Say no to typos.

npm install -d http-status-code-const-enum

Basic usage:

import {Request, Response} from 'express';
import {HttpStatusCode} from 'http-status-code-const-enum';

function myHandler(req: Request, res: Response) {
  res.status(HttpStatusCode.NO_CONTENT)
    .end();
}

Please note that this is a const enum, meaning it cannot be used in a pure JavaScript environment and is therefore only suited for TypeScript.