is it possible to "yield" a async process in node v10.x?

i'm using the request module to fetch image from website and pipe it into local file, the code is like:

url = http:/xxx.com/x.jpg;
if(url){
  request(url).pipe(localFilePath);
}

if(xxx){
  // save the localFilePath to db;
  redirect('/index');
}

// The question is the filePath is needed in the index page, so if the file has not downloaded yet, then it can not show the file on index page.

i tried.

request(url).pipe(...).on('end',function(){
  ....
}); 

but it seems does't work..

so, i wonder how to do like :

yield xxxxx in node v0.11.x to pause the process until the file is already downloaded completely?

thanks

Yield is only presently available in Node 0.11 (when using the –harmony flag), but this is an unstable release that is probably not suitable for any kind of production use. Node 0.12 shouldn’t be too far away though, as 0.11 has been in development for a while now. So the good news is generators will be available in a stable Node.js release near you very soon!

If you want to stick with 0.10.x you will have to use callbacks or promises for now.