-
-
Notifications
You must be signed in to change notification settings - Fork 140
Description
The Buffer
and EventEmitter
objects in Node.js are quite possibly the most used APIs in the npm ecosystem. The buffer
polyfill on npm sees over 45 million downloads per week. Deno has decided to implement an entire Node.js compatibility layer that includes both Buffer
and EventEmitter
. Other JavaScript runtimes (like Cloudflare Workers) that seek to support the existing ecosystem of npm modules have to make a decision about implementing these non-standard Node.js specific APIs. If they don't, they end up restricting themselves and what their users can do. While there are standardize alternatives (e.g. typed arrays and EventTarget), Buffer
and EventEmitter
are so broadly used as to qualify as de facto standards.
What I'd like to propose is that we publish specifications for the EventEmitter
and Buffer
APIs such that they can (a) be reliably implemented in other platforms with compatible semantics and (most importantly) ... (b) won't have any breaking changes made to the APIs decided unilaterally only by Node.js without seeking input from other implementing runtimes.
I'd like to get this on the TSC agenda for discussion.