denoland / denoland/std

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

Open
#6,284 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

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](https://docs.deno.com/api/deno/~/Deno.stdout) that "It is not guaranteed that the full buffer will be written in a single call" (as do the corresponding methods of [`Deno.stderr`](https://docs.deno.com/api/deno/~/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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.