unjs / unenv

๐Ÿ•Š๏ธ Convert javaScript code to be runtime agnostic
MIT License
417 stars 21 forks source link

feat(node:cluster): polyfill `node:cluster` module #197

Closed jculvey closed 4 months ago

jculvey commented 4 months ago

Replaces the current auto-mocking of 'cluster' to support destructured ESM imports and allow for functional polyfill coverage in the future.

๐Ÿ”— Linked issue

โ“ Type of change

๐Ÿ“š Description

Adds a polyfill for the node:cluster module.

๐Ÿ“ Checklist

pi0 commented 4 months ago

Nice work.

Checking Node.js implementation it seems they directly assign certain properties to the instance of EventEmitter. perhaps we can make it closer to this?

pi0 commented 4 months ago

Thanks.