pinojs / sonic-boom

Extremely fast utf8 only stream implementation
MIT License
261 stars 41 forks source link

Problem when importing events using default #177

Closed richtera closed 1 year ago

richtera commented 1 year ago

This line https://github.com/pinojs/sonic-boom/blob/13cfec0562b1d99a6b8cbe509feaa3e7a8997368/index.js#L4C1-L4C39 should really be const { EventEmitter } = require("events") otherwise it will cause problems with bun for example. Patching the npm works fine for now.

mcollina commented 1 year ago

Thanks for reporting.

Ultimately Bun does not implement all Node.js APIs. It's not a clean drop-in replacement for Node.js (despite their claims). Please refer to the Bun Discord or Issue Tracker for such questions.

richtera commented 1 year ago

True, but default exports are a bit questionable even in node :). The rest of the code I think already does it correctly. Alright it's fine.