documentation/test/utils.js
Tom MacWright 50aaf9d35b --watch and --serve flags
These new flags replace the functionality of
dev-documentation
2015-11-24 11:21:11 -05:00

16 lines
328 B
JavaScript

var http = require('http'),
concat = require('concat-stream');
function get(url, callback) {
http.get(url, function (res) {
res.pipe(concat(function (text) {
if (res.statusCode >= 400) {
return callback(res.statusCode);
}
callback(text.toString());
}));
});
}
module.exports.get = get;