unjs / unenv

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

feat(node:os): polyfill `node:os` module #190

Closed jculvey closed 1 month ago

jculvey commented 1 month ago

๐Ÿ”— Linked issue

โ“ Type of change

๐Ÿ“š Description

Adds a polyfill for the node:os module.

Curious for feedback on EOL and devNull. I don't see an "unimplemented" pattern in place for handling string constants exported by modules other than specifying a dummy value. LMK if y'all think there's a better value to use for either of these.

๐Ÿ“ Checklist

pi0 commented 1 month ago

@jculvey @IgorMinar i've added implementation too. Constants is little bit long (but treehsakable and when minified small). Wdyt?

IgorMinar commented 1 month ago

@jculvey if you are happy with this PR please go ahead and merge

jculvey commented 1 month ago

@jculvey if you are happy with this PR please go ahead and merge

Yup LGTM. Thanks again @pi0 for fixing this up!