mirror of
https://github.com/Brandon-Rozek/Rozbot.git
synced 2024-11-07 20:30:34 -05:00
13 lines
330 B
JavaScript
13 lines
330 B
JavaScript
var fetch = require('fetch').fetchUrl;
|
|
var promise = require('promise-polyfill');
|
|
module.exports = function(link, options) {
|
|
return new promise(function(resolve, reject) {
|
|
fetch(link, options, function(error, meta, body) {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
resolve({meta: meta, body: body});
|
|
}
|
|
});
|
|
});
|
|
}
|