#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)
1 messages · Page 1 of 1 (latest)
What's the alternative API in Bun to the res.write API in node?
return Response with a readable stream
Like this:
const stream = new ReadableStream({
start(controller) {
controller.enqueue("hello");
controller.enqueue("world");
controller.close();
},
});
Right?
yes
Thanks