qreq

0.2.0 • Public • Published

qreq

Build Status

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

Readme

Keywords

Package Sidebar

Install

npm i qreq

Weekly Downloads

1

Version

0.2.0

License

ISC

Last publish

Collaborators

  • jpstevens