Skip to content

Replace concat-stream with text() from node:stream/consumers #92

Description

@ChristianMurphy

Initial checklist

Problem

Node now ships text() in node:stream/consumers, which reads a whole stream into a string.
That's all we use concat-stream for, reading streamIn in lib/file-set-pipeline/stdin.js.
Every remark-cli/rehype-cli/etc user installs concat-stream, plus its transitive tree.

Current solutions

  • keep concat-stream

Proposed solutions

text() was added in Node 16.7.0, so it fits our policy of keeping ^11 compatible with Node 16, and doesn't need to wait for a major.

Things to watch for:

  • text() rejects when the stream errors, concat-stream never calls back, so that path needs wiring into next(error) and a test to keep coverage at 100%

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🤞 phase/openPost is being triaged manually

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions