httpstatuses
Version:
Friendly interface for working with HTTP status codes
20 lines (12 loc) • 1.08 kB
Markdown
# HTTP Statuses
Plain-English interface for working with HTTP status codes.
[](https://travis-ci.org/rampantmonkey/httpstatuses) [](https://www.npmjs.org/package/httpstatuses) [](http://opensource.org/licenses/MIT)
## Why?
The standard `http` module provides a [`STATUS_CODES` object](http://nodejs.org/api/http.html#http_http_status_codes) that returns a string describing the given status code. While this is quite useful, I want to go the opposite way with the goal of improving code readability.
## Example
httpStatuses = require('httpstatuses')
console.log(httpStatuses.not_found) # 404
console.log(httpStatuses[404]) # Not Found
## License
_This software is released under the MIT license._
You can find a copy in [LICENSE.txt](LICENSE.txt) or at [opensource.org](http://opensource.org/licenses/MIT).