Skip to content

Introduce buffer relative methods #58348

Open
@araujogui

Description

@araujogui

What is the problem this feature will solve?

Sequential buffer operations requires manual offset tracking. This is error-prone and verbose. Many developers already create abstractions around Buffer to avoid it completely.

@nodejs/buffer

What is the feature you are proposing to solve the problem?

Introducing relative methods to Buffer with automatic internal position tracking would simplify usage and improve developer experience in scenarios where data is read or written sequentially.

This is inspired by abstractions like Java’s ByteBuffer and Rust’s ByteBuffer.

It can be implemented in a backward-compatible manner by adding new get and put methods, without modifying existing read or write methods.

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions