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

141
Views
I want to get the value of this function but i cant access it

How can I access the value of function result into a variable, actually I am trying to get the value from this function and save it into a variable so then I can submit this value into POST request, but right now I am unable to get the value, what I did in this function I have puppeteer node js code I have a result of OCR into a variable and I just need to submit this OCR result into POST login function.

  let res = "";
  // Run and wait the result
  ocrSpaceApi.parseImageFromLocalFile(imageFilePath, options)
    .then(function (parsedResult) {
      //console.log('parsedText: \n', parsedResult.parsedText);
      res =  parsedResult.parsedText;
      console.log(res);
    }).catch(function (err) {
      console.log('ERROR:', err);
    });
    console.log(res);

want the parsed result in RES varaiable.

about 4 years ago · Juan Pablo Isaza
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!