Skip to content

Correct syntax for using await to wait until streaming is complete? #1

@kevinchiu

Description

@kevinchiu

What is the correct syntax for waiting until streaming a buffer is complete?

Currently, I have something like:



  let read = streamifier.createReadStream(imgBuffer)
  let upload = s3Stream.upload({
    Bucket: 'website.com',
    Key: 'website/' + filename
  })
  upload.on('error', function (error) {
    console.error(error)
  })
  await read.pipe(upload)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions