pinojs / sonic-boom

Extremely fast utf8 only stream implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem when importing events using default

richtera opened this issue · comments

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.

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.

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.