Open this example in the interactive library
Source code
const source = () =>
new ReadableStream({
start(c) {
c.enqueue("a");
c.enqueue("b");
c.close();
},
});
console.log(
new WritableStream(undefined, { highWaterMark: 4 }).getWriter().desiredSize,
);
Sample output
4
