You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to sequentially archive (using node-archiver) a couple of remote files fetched using bent:
constappendTracks=async(archive,items)=>{items.forEach(async(item)=>{constbeatStream=awaitbent(item.publicUrl)();// mp3s **archive.append(beatStream,{name: item.name});// ********** the following doesn't seem to work ****************awaitnewPromise((resolve,reject)=>{beatStream.on('end',()=>{// is this even possible ??? 🤷🏻♂️resolve();});beatStream.on('error',(err)=>{reject();});});});};archive.pipe(res);appendTracks(archive,order.items).then(()=>archive.finalize());
How do I ensure one stream is done before the next download begins?
Need to guarantee that archive.finalize() isn't fired prematurely, which is what is happening right now.
The text was updated successfully, but these errors were encountered:
I am trying to sequentially archive (using node-archiver) a couple of remote files fetched using bent:
How do I ensure one stream is done before the next download begins?
Need to guarantee that
archive.finalize()
isn't fired prematurely, which is what is happening right now.The text was updated successfully, but these errors were encountered: