Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
geting async YouTube title from get-youtube-title npm library

I need to get a title from YouTube video. How can I change a request from this library to be async? Actually this returns undefined

this is a vue.js app

async addNewVideoToLocalStorage() {
     let id = getIdFromURL(this.videosUrl[0].url);
     let title = await getYoutubeTitle(id, async (e, t) => await t);
}

https://www.npmjs.com/package/get-youtube-title

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!