geting async YouTube title from get-youtube-title npm library
data: () => ({
title: "",
})
async get_title() {
var getYoutubeTitle = require('get-youtube-title');
let id = 'QR1jRM4XTyc';
await getYoutubeTitle(id, (e, t) => {
return this.title = t
})
console.log(this.title);
}
async , await cannot work in getYoutubeTitle 🥺
try this way