This type defintion utilizes the const enum feature of typescript to replace the status code name with it's code number at compile time.
Just install the typings:
typings install --save --global lib~http-status-codes
And use it:
const ok = HTTPStatusCodes.OK;
ok === 200 // true
To see the full list checkout the typings file.
Note: Make sure --preserveConstEnums
is not passed to the compiler.
This project is licensed under the MIT license.