#How do I response a chunk of a body like the res.write API in Nodejs with Bun?

1 messages · Page 1 of 1 (latest)

wild roost
#

What's the alternative API in Bun to the res.write API in node?

sharp harbor
#

return Response with a readable stream

wild roost
#

Like this:
const stream = new ReadableStream({
start(controller) {
controller.enqueue("hello");
controller.enqueue("world");
controller.close();
},
});
Right?

sharp harbor
#

yes

wild roost
#

Thanks