Skip to content

jpstevens/qreq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qreq

Build Status Downloads/month

A q-style promise wrapper for HTTP requests

Installation:

To install, go to your console/terminal and run:

npm install qreq

Usage:

In your project, require the package:

var qreq = require("qreq");

To make a GET request, using the promise syntax:

qreq
  .get("http://google.com")
  .then(function(res){
    console.log(res.body);
    //...
  })
  .fail(function(err){
    console.log(err);
    //...
  });

To make a GET request, using the callback syntax:

qreq.get("http://google.com", function(err, res){
  if(err){
    console.log(err);
    //...
  } else {
    conslole.log(res.body);
    //...
  }
});

Change log:

0.2.0 - Adds callback functionality

About

A q-style promise wrapper for HTTP requests

Resources

Stars

Watchers

Forks

Packages

No packages published