http-status-code-const-enum
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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.

Package Sidebar

Install

npm i http-status-code-const-enum

Weekly Downloads

64

Version

1.0.2

License

MIT

Unpacked Size

21.3 kB

Total Files

5

Last publish

Collaborators

  • alorel