javascript v3 sdk s3.GetObjectCommand download stream

0

In the new v3 javascript sdk, how does streaming download of an s3 object work? I used to use getObject(params).createReadStream().pipe(out), but createReadStream is not defined here:
s3.send(new GetObjectCommand(params)).createReadStream();

已提问 3 年前10007 查看次数
1 回答
0

This answers it:
https://github.com/aws/aws-sdk-js-v3/issues/1096

the returned property, Body, is a streamable, so response.Body.pipe(createWriteStream(fileName));

已回答 3 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则