Skip to content

Undocumented buffer.***Slice() methods #46467

Closed as not planned
Closed as not planned

Description

@jasnell

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?

Activity

  1. anonrig commented on Feb 2, 2023

    @anonrig
    Member

    I'm +1 on deprecating all non public APIs on buffer.

  2. mscdex commented on Feb 2, 2023

    @mscdex
    Contributor

    -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.

  3. jasnell commented on Feb 2, 2023

    @jasnell
    MemberAuthor

    I'm fine with documenting them. We just shouldn't leave them public and undocumented

  4. added
    bufferIssues and PRs related to the buffer subsystem.
    docIssues and PRs related to Node.js documentation.
    and removed
    docIssues and PRs related to Node.js documentation.
    on Feb 2, 2023
  5. added
    docIssues and PRs related to Node.js documentation.
    on Apr 28, 2026
  6. ChALkeR commented on Apr 28, 2026

    @ChALkeR
    Member

    also .*Write

  7. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    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.

  8. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jul 28, 2026
  9. github-actions commented on Aug 27, 2026

    @github-actions
    Contributor

    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.

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

    bufferIssues and PRs related to the buffer subsystem.docIssues and PRs related to Node.js documentation.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions