You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Buffer has long had a number of undocumented methods like Buffer.prototype.asciiSlice() and Buffer.prototype.utf8Slice()... The question is: should these be documented as part of the public API? Or should public access to them be slowly deprecated and removed?
-1 I strongly believe we should not remove them. These encoding-prefixed methods (including -Write()), while undocumented, can provide significant speed improvements when you know the encoding ahead of time, allowing you to skip encoding name parsing and various other checks.
If it's any consolation, they could be added to the documentation with the additional recommendation that toString() and write() be used in most/general cases (especially when the encoding is variable) or something to that effect.
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Activity
anonrig commentedon Feb 2, 2023
I'm +1 on deprecating all non public APIs on buffer.
mscdex commentedon Feb 2, 2023
-1 I strongly believe we should not remove them. These encoding-prefixed methods (including -
Write()), while undocumented, can provide significant speed improvements when you know the encoding ahead of time, allowing you to skip encoding name parsing and various other checks.If it's any consolation, they could be added to the documentation with the additional recommendation that
toString()andwrite()be used in most/general cases (especially when the encoding is variable) or something to that effect.jasnell commentedon Feb 2, 2023
I'm fine with documenting them. We just shouldn't leave them public and undocumented
doc: document undocumented method on buffer prototype
ChALkeR commentedon Apr 28, 2026
also
.*Writegithub-actions commentedon Jul 28, 2026
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
github-actions commentedon Aug 27, 2026
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
doc: document Buffer encoding-specific Slice and Write methods