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

161
Views
Typescript support for async.auto in async.js library

How do we strongly type each of the async auto tasks? let's say get_data returns a number and email_link returns a string and I finally want to return the email_link task. I am unable to figure out how to strongly type each of those tasks and the result value.

async () => {
try {
    let results = await async.auto({
        get_data: async function() {
            // async code to get some data
            return someNumber;
        },
        make_folder: async function () {
            // async code to create a directory to store a file in
            // this is run at the same time as getting the data
           return something;
        },

        email_link: ['write_file', async function() {
            // once the file is written let's email a link to it...
            return someString;
        }]
    });
    console.log('results = ', results);
   return results.email_link;
}
catch (err) {
    console.log(err);
}

}

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!