const fetch = require('node-fetch');
const res = await fetchData('https://some-random-api.ml/lyrics?title=toosie%20slide', 'author'); // ==> "Drake"
console.log(res); // Logs "Drake" into console
function fetchData(url, value) {
const val = fetch(url)
.then((res) => res.json())
.then((data) => {
return data[value];
}).catch((err) => console.warn(err));
return val;
}