Skip to content
Discussion options

You must be logged in to vote

Yes. You need to transform the stream of Responses into a stream of objects with a name property (your custom filename) and an input property (the Response) and optionally lastModified as specified here. You can do that easily with an async generator (because DownloadStreams are AsyncIterable) :

const dlstream = new DownloadStream(yourInputURLsOrRequests)
async function *namedInput() {
  for await (const response of dlstream) yield {
    name: "your custom name.ext",
    input: response,
    lastModified: response.headers.get('Last-Modified')
  }
}
const zipRersponse = downloadZip(namedInput())

Sometime in the near future, it will be possible to use a TransformStream (because all Readable…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chris-rudmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants