deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

What's happening with `writeAll` and `writeAllSync`?

Open lionel-rowe opened this issue 10 months ago • 3 comments
trafficstars

Context:

  • Deno.writeAll and Deno.writeAllSync were deprecated and then removed.
  • writeAll and writeAllSync of @std/streams were deprecated, moved to @std/io, and then removed.
  • Per https://github.com/denoland/std/issues/5003, @std/io is no longer due for stabilization in order to "to nudge people to use @std/streams instead".
  • Docs for Deno.stdout.write and Deno.stdout.writeSync both warn that "It is not guaranteed that the full buffer will be written in a single call" (as do the corresponding methods of Deno.stderr).

In light of all that, what if anything is the stabilization path for a high-level "write all this stuff to stdout/stderr (with no newline at the end) and definitely don't bail part-way through" method in Deno/std?

Conversely, is there any reason for that method not to simply be Deno.std(out|err).write(Sync)?? I'm struggling to think of any low-level use case where it'd be preferable to bail part-way through in an unspecified way (as opposed to, say, relying on userland code to chunk/paginate the input as appropriate).

lionel-rowe avatar Dec 20 '24 04:12 lionel-rowe