Add a method to unset encoding on a stream
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
What is the problem this feature will solve?
Currently it is impossible to unset the encoding of a ReadableStream once setEncoding is called. This makes it impossible to obtain Buffers from the stream again after temporarily switching to an encoding. I know that this could be worked around but there is a much better fix which is backward compatible.
In my opinion, this is a major parity issue in the API.
What is the feature you are proposing to solve the problem?
I propose adding a new special buffer encoding which will unset/reset the encoding so that the stream returns a buffer again.
What alternatives have you considered?
I originally thought binary encoding was supposed to do this but then I found out that it's just an alias for latin1! Any alternatives outside of the standard library will always be inferior to a new option which would be available to everyone using new versions with this proposed fix 😄
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the ReadableStream setEncoding implementation and its existing encoding-related tests. Trace how encoding changes affect returned chunks, then define completion as supporting the proposed special buffer encoding so the stream returns Buffers again after an encoding was set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100