How ot use this with an reader? #14
Replies: 8 comments 5 replies
-
If you use If you are forced to use the older version, just use fromWeb() to adapt |
Beta Was this translation helpful? Give feedback.
-
@uhop Issue with that is that the body has a wreid format. I also looked into the json version, and my body is structured as following:
typeValue has no quotes, type is the key, typeValue is the value, data is a json string which is not always in a chunk, I am trying to get it working with stream-json by creating a custom reader that failed as well. Also I use stream-chain 3.1.0 and it does not like it at all, perhaps the typescript definitions are outdated? |
Beta Was this translation helpful? Give feedback.
-
This is also related: uhop/stream-json#159 |
Beta Was this translation helpful? Give feedback.
-
What "typescript definitions"? In any case you are welcome to fix them. |
Beta Was this translation helpful? Give feedback.
-
If I understood correctly, you use some custom format (not JSON) and have problems with facilities outside of this library. Is this the correct situation? |
Beta Was this translation helpful? Give feedback.
-
Basically this is the code I am trying to run, and my goal is to either use chain to only read the json or all the data, I am quite new to the library and find it a bit difficult to use. Regarding the typescript issue, If you state that compability is a Thing I will push a fix for that latest tommorow, the error state is the following:
|
Beta Was this translation helpful? Give feedback.
-
Could you provide a representative (simulated, as small as possible) sample of data you read? Otherwise, it is difficult to understand the code. |
Beta Was this translation helpful? Give feedback.
-
I found a solution without stream chain, thank you for your help |
Beta Was this translation helpful? Give feedback.
-
I have a response where I get back a readstream from a fetch call:
const reader = res.response.body!.getReader();
How can I use this with a chain? I tried converting it a few times but failed always...
Beta Was this translation helpful? Give feedback.
All reactions