This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var concat = require("concat-stream"); | |
var hyperquest = require("hyperquest"); | |
var stream = require("stream"); | |
// Wait for the request to finish or fail | |
function promisify(req) { | |
return new Promise(function (resolve, reject) { | |
req.on("error", reject).pipe(concat({ encoding: "string" }, resolve)); | |
}); |