Download s3 object to disk

I have wired up a method that gets an s3 object to the client, using the AWS SDK.

Using the getObject method, I’m left on the client with a callback:
(error, data) => {}

The file is contained in data.Body, but I have no idea what to do with this. How do I download it to a file on my computer from there?

Figured it out, using the file-saver npm package:

const blob = new Blob([data.Body], { type: data.ContentType }); fileSaver.saveAs(blob, myFileName);