Skip to content

Instantly share code, notes, and snippets.

View skabbes's full-sized avatar

Steven Kabbes skabbes

  • Dropbox
  • Phoenix, AZ
View GitHub Profile
/* Fetch a file from s3 as a Stream
*
* @param fileId the fileId to fetch
* @return {stream: Stream, meta, contentType, contentLength}
*/
export async function fetchStream({ fileId }) {
try {
const key = makeS3Key(fileId);
const fileOpts = { Bucket: BUCKET, Key: key };
const { stream, data } = await Promise.props({