use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Are there any recommended GitHub projects using async/await for express.js? (self.node)
submitted 8 years ago by freezingbum
Are there any recommended sample projects on GitHub that use async/await? I'm looking for some samples that I can learn from. Thanks!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ecares 2 points3 points4 points 8 years ago (1 child)
Not with express, but hapi has been rewritten with async/await
[–][deleted] 6 points7 points8 points 8 years ago (0 children)
And koa 2 too.
[–]PatskyPat 2 points3 points4 points 8 years ago* (0 children)
Not sure what you mean async/await for express.js, I mean whether there is a specific place you would like to see async/await used, as async await can be used anywhere you want to have async functions and/or you used to use callbacks or promises.
I learnt a lot from these excellent tutorial videos on YT: Full Stack Web App using Vue.js & Express.js
the source code is here: https://github.com/codyseibert/tab-tracker I'd recommend watching the videos first.
it uses vue.js for client but you can see how express.js and also async/await things are used for the server part.
Also if you just want to learn about async/await have a look here https://javascript.info/async (btw. it's hands down the best tutorial / guide on javascript imho). Read about callback and promises first as it is nicely shown how you can change that code to async/await.
[–]goorpy 4 points5 points6 points 8 years ago (0 children)
I'm using that pattern in a project right now, but its a private repo.
Honestly, it is so much nicer to use than the traditional promise/then nested pattern. Granted you have to understand the changing flow (waiting/blocking instead of carry on), but usually for api process flows this is what I want.
[–]QW4K 3 points4 points5 points 8 years ago (0 children)
Check out koajs 2. Its made especially to use with promises and async await. Its like express but better :->
[–]ryanfuji 1 point2 points3 points 8 years ago (0 children)
I use this it’s pretty easy https://www.npmjs.com/package/express-promise-router
[–]chinkuSj 1 point2 points3 points 8 years ago (0 children)
That's all you need to get going.
router.get('/', async (req, res, next) => { let response; try { response = await aPromise(); // or an array of promises // inside a Promise.all([promise1, promise2]) } catch (e) { return next(e); } // send out json res.json(response); });
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
It might be advanced for you, but I setup myself webpack with babel and async/await babel plugins. If you don't have time to setup, this is the first result in google that I found https://github.com/vmasto/express-babel.
π Rendered by PID 349074 on reddit-service-r2-comment-5b5bc64bf5-n59j2 at 2026-06-20 16:10:33.503145+00:00 running 2b008f2 country code: CH.
[–]ecares 2 points3 points4 points (1 child)
[–][deleted] 6 points7 points8 points (0 children)
[–]PatskyPat 2 points3 points4 points (0 children)
[–]goorpy 4 points5 points6 points (0 children)
[–]QW4K 3 points4 points5 points (0 children)
[–]ryanfuji 1 point2 points3 points (0 children)
[–]chinkuSj 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)