¿Cómo puedo devolver el resultado de node-fetch como una variable? Me gustaría poder llamar a esta función y hacer que devuelva el objeto JSON.
async function getbody(configType){ const response = fetch(getURL(configType), { method:'GET', headers: { 'Authorization' : `token ${GITHUB_TOKEN}`, 'Accept' : `application/vnd.github.VERSION.raw+json`, 'Content-Type': `application/json` }}) .then(res => res.json() ) .then(data => obj = data) .catch((err) => console.log(err)); module.exports = async () => { getBody(configType) }