node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »


Build Status

HTTP Status code for Node

Utility to interact with HTTP status code.


Once you require this module, you may call it with either an HTTP code or a message name. With an HTTP code, you will get the message name while with a message name you will get an HTTP code. Simple.


This module is very simple. A documentation would be more complicate than reading the original code.

API sample

  var HTTPStatus = require('http-status');
  // Print "Internal Server Error" 
  // Print 500 

Express sample

  var express = require('express'),
    redis = require('redis'),
    HTTPStatus = require('http-status');
  var app = express.createServer();
  app.get('/', function (req, res) {
    var client = redis.createClient(); (err, msg) {
      if (err) {
        return res.send(HTTPStatus.INTERNAL_SERVER_ERROR);
      res.send(msg, HTTPStatus.OK);