IssueRaiser

Start moving to Uint8Array in new APIs?

There was a suggestion by @jasnell to use `Uint8Array`s in new APIs over `Buffer`s as well as a weigh-in by @sindresorhus saying it is easier to author cross-platform APIs when using `Uint8Array`s. Here is a context https://github.com/nodejs/node/pull/41553#discussion_r786284208 That is, the ask here is that Node.js should prefer `Uint8Array`s over `Buffer`s in new APIs. What does everyone think? Should we stick to `Buffer` (which is a subclass of `Uint8Array` as a reminder) or prefer `Uint8Array`s over buffers when possible in new APIs? cc @nodejs/buffer @nodejs/streams

Posted by benjamingr on Jan 19, 2022, 7:49 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Software)

Start moving to Uint8Array in new APIs?

benjamingrJan 19, 2022, 7:49 AM

There was a suggestion by @jasnell to use `Uint8Array`s in new APIs over `Buffer`s as well as a weigh-in by @sindresorhus saying it is easier to author cross-platform APIs when using `Uint8Array`s. Here is a context https://github.com/nodejs/node/pull/41553#discussion_r786284208 That is, the ask here is that Node.js should prefer `Uint8Array`s over `Buffer`s in new APIs. What does everyone think? Should we stick to `Buffer` (which is a subclass of `Uint8Array` as a reminder) or prefer `Uint8Array`s over buffers when possible in new APIs? cc @nodejs/buffer @nodejs/streams

Comments (0)

No comments yet. Start the discussion.

Comment on this issue