Skip to content

types/lib-http-status-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Status Codes

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.

License

This project is licensed under the MIT license.

About

HTTP Status Codes using const enum

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published