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

98
Views
turning nodejs function into async await

I have the JS code below that needs to be turned into an async function so I can await for the output.

I am unsure how to do it and any help would be much appreciated.

client.getSecretValue({SecretId: secretName}, function(err, data) {
  //do stuff
  output = data
  //return output
}

console.log(output) //currently returns undefined

I want to log the value of output but right now it does not work because it getsecretvalue is not finished.

How can I do this?

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!