apostrophe-site-map
Version:
Generate site maps for sites powered by the Apostrophe CMS.
21 lines (18 loc) • 413 B
JavaScript
const fetch = require('node-fetch');
// Optional callback for older tests
module.exports = async function get(url, callback) {
if (callback) {
try {
const result = await body();
return callback(null, result);
} catch (e) {
return callback(e);
}
} else {
return body();
}
async function body() {
const response = await fetch(url);
return response.text();
}
};