Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Buffer.copy to take an ArrayBuffer #53700

Open
ronag opened this issue Jul 2, 2024 · 3 comments
Open

Allow Buffer.copy to take an ArrayBuffer #53700

ronag opened this issue Jul 2, 2024 · 3 comments
Labels
buffer Issues and PRs related to the buffer subsystem. feature request Issues that request new features to be added to Node.js. performance Issues and PRs related to the performance of Node.js.

Comments

@ronag
Copy link
Member

ronag commented Jul 2, 2024

What is the problem this feature will solve?

Avoid creating a temporary typed buffer:

Buffer.from(arrayBuffer).copy(dst, 0)

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

Buffer.copy(arrayBuffer, dst, 0)

What alternatives have you considered?

No response

@ronag ronag added the feature request Issues that request new features to be added to Node.js. label Jul 2, 2024
@ronag
Copy link
Member Author

ronag commented Jul 2, 2024

@nodejs/performance @joyeecheung

@RedYetiDev RedYetiDev added the buffer Issues and PRs related to the buffer subsystem. label Jul 2, 2024
@aduh95
Copy link
Contributor

aduh95 commented Jul 4, 2024

Buffer.copyWithin might be a clearer name than Buffer.copy.

@ronag ronag added the performance Issues and PRs related to the performance of Node.js. label Jul 12, 2024
@sophonieb
Copy link
Contributor

@ronag I'm going to work on this feature :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. feature request Issues that request new features to be added to Node.js. performance Issues and PRs related to the performance of Node.js.
4 participants