Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement Compression and Decompression streams #35

Open
grabbou opened this issue Nov 10, 2024 · 1 comment
Open

feat: implement Compression and Decompression streams #35

grabbou opened this issue Nov 10, 2024 · 1 comment

Comments

@grabbou
Copy link
Collaborator

grabbou commented Nov 10, 2024

Last piece for the showcase.

This should work:

  const [fileHandle] = await showOpenFilePicker()
  const file = await fileHandle.getFile()

  const compressed = file.stream().pipeThrough(new CompressionStream('gzip'))

  await fetch('http://localhost:3002/upload', {
    method: 'POST',
    body: compressed,
  })
@grabbou
Copy link
Collaborator Author

grabbou commented Nov 14, 2024

Compression stream is implemented, needs decompression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant