question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES2017 async / await functions with Gulp

See original GitHub issue

Env: Gulp 4 Node 7.6.0

Can I use ES2017 async functions with Gulp?


function delay(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

gulp.task('sumo', async ()  => {
         await delay(3000);
        return "success"
});

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
phatedcommented, Feb 14, 2018

This thread promotes a lot of old patterns that we don’t suggest anymore (registering with strings vs using named functions, etc) so don’t follow anything here. We’re working on updated docs that explain async/await usage in more detail.

0reactions
phatedcommented, Dec 18, 2018

@Evertcolombia what you wrote is completely incorrect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Async Await + Gulp - unable to minify JavaScript?
Had similar issue with gulp-uglify, and as I've found out it seems that minifying async/await is not supported with base gulp-uglify , so...
Read more >
Async Completion - gulp.js
When a stream, promise, event emitter, child process, or observable is returned from a task, the success or error informs gulp whether to...
Read more >
Complete Guide to JS Async & Await ES2017/ES8 - YouTube
Learn about the fancy new async and await keywords in JavaScript. ... asynchronous code with a callbacks to instead use async functions.
Read more >
Compiling ES6 with Gulp and Babel
How can we use Gulp to compile our ES6 and beyond into browser-compliant ES5. ... and exciting methods available to you in modern...
Read more >
Understanding JavaScript's async await - Ponyfoo
When Async Functions finally hit the road, we'll be able to take our Promise -based implementation and have it take advantage of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found