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

Implement new BZZ APIs for browser #25

Open
PaulLeCam opened this issue Aug 31, 2018 · 3 comments
Open

Implement new BZZ APIs for browser #25

PaulLeCam opened this issue Aug 31, 2018 · 3 comments

Comments

@PaulLeCam
Copy link
Collaborator

Ideally matching the node ones as much as possible, but supporting browser APIs such as Blob, FileReader, etc.

@PaulLeCam PaulLeCam added this to the Community release milestone Aug 31, 2018
@PaulLeCam PaulLeCam removed this from the v0.4 milestone Sep 14, 2018
@AuHau
Copy link
Contributor

AuHau commented Nov 12, 2019

Yeah, this will be quiet important. Especially not being able to download directory in browser is quite problematic.

Upon some research, there is support for streams in a browser using readable-stream. I will try to make an initial PR that will implement this package for using downloadObservable and downloadDirectory for browser as well.

@AuHau
Copy link
Contributor

AuHau commented Nov 29, 2019

Do you think there is still some more API to be implemented in browsers? I think the only "node" specific APIs are those related to FS, which won't be ever implemented browser...

@PaulLeCam
Copy link
Collaborator Author

I was mostly thinking about supporting APIs that are available in the browser but AFAIK not in node, such as Blob, File, FileList and ReadableStream.

For example we could have a downloadBlob() function, uploadFile() could accept File and ReadableStream as inputs and uploadDirectory() could accept a FileList input, that would make it very simple to upload the contents of an <input type="file"> to Swarm.
Basically the same way the node-specific APIs make it easy to interact with the local FS, I think browser-specific APIs could be used to support higher-level application use cases.

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

No branches or pull requests

2 participants