httpstatus

HTTP status class for NodeJS

node-http-status

HTTP status class for NodeJS

$ npm install httpstatus
var HTTPStatus = require('httpstatus');
var status = new HTTPStatus(403);
 
status.code; //=> 403 
status.description; //=> "Forbidden" 
status.is(403); //=> true 
status.is(500); //=> false 
status.isInformational; //=> false 
status.isSuccess; //=> false 
status.isRedirection; //=> false 
status.isClientError; //=> true 
status.isServerError; //=> false 
status.isError; //=> true