request-callback-wrapper

Wraps a callback for request to handle errors, status codes and ECONNREFUSED in a nicer way

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
request-callback-wrapper
2.0.08 years ago10 years agoMinified + gzip package size for request-callback-wrapper in KB

Readme

request-callback-wrapper
Wraps a callback for request to handle errors, status codes and ECONNREFUSED in a nicer way

Usage

var wrapCallback = require('request-callback-wrapper'),
    request = require('request');

request('/users', wrapCallback(function(error, users){
        if(error){
            return console.log(error);
        }

        console.log(users);
    })
);