Skip to content

Instantly share code, notes, and snippets.

View jasoncrawford's full-sized avatar

Jason Crawford jasoncrawford

View GitHub Profile
@jasoncrawford
jasoncrawford / client.js
Last active December 18, 2015 10:49
Start of a simple promise-based HTTP client, based on Q-IO and inspired by SuperAgent
var http = require('q-io/http');
var BufferStream = require('q-io/buffer-stream');
// Response
function Response(promise) {
this.promise = promise;
this.status = this.promise.get('status');