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

Web Streams API support? #359

Open
rybesh opened this issue Jul 7, 2023 · 4 comments
Open

Web Streams API support? #359

rybesh opened this issue Jul 7, 2023 · 4 comments

Comments

@rybesh
Copy link

rybesh commented Jul 7, 2023

Are there any plans to implement Web Streams API support (rather than Node streams)?

@jeswr
Copy link
Collaborator

jeswr commented Jul 8, 2023

There are no plans at the moment.

What's your use case?

@rybesh
Copy link
Author

rybesh commented Jul 11, 2023

The Fetch API returns a Response object, the body of which is a Streams API ReadableStream, not a Node ReadableStream. It would be nice to be able to pipe that stream to an N3.StreamParser, rather than fiddling with converting it to a Node stream first (since I'm bundling for the browser, not Node).

@jeswr
Copy link
Collaborator

jeswr commented Jul 11, 2023

Have you come across rdf-dereference? It uses N3 under the hood for parsing and also handles all of this stream fetching stuff https://www.npmjs.com/package/rdf-dereference.

It is built using Comunica so this is how it is going between Web and Node streams under the hood https://github.com/comunica/comunica/blob/b86d55278c455b56f9fd003254fd56616f9e7087/packages/actor-dereference-http/lib/ActorDereferenceHttpBase.ts#L106.

@rybesh
Copy link
Author

rybesh commented Jul 11, 2023

Thanks, it looks like toNodeReadable has an example of what I needed. rdf-dereference looks useful as well.

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

2 participants