wtf_wikipedia
Version:
parse wikiscript into json
16 lines (15 loc) • 411 B
JavaScript
const unfetch = require('isomorphic-unfetch')
/**
* use the native client-side fetch function
*
* @private
* @param {string} url the url that well be fetched
* @param {RequestInit} opts the options for fetch
* @returns {Promise<any>} the response from fetch
*/
const request = function (url, opts) {
return unfetch(url, opts).then(function (res) {
return res.json()
})
}
module.exports = request