http-status-code-const-enum
v1.0.2
Published
Basic const enum declaration for HTTP status codes
Downloads
2,409
Maintainers
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.