-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added partial support for node:os > userInfo function #19945
Conversation
53e3dc9
to
f871aa7
Compare
most packages in node uses os.userInfo to read username, shell or homedir. this changes still causes an exception on trying to read uid and gid and supports only utf-8 option for now but that's a start.
const homedir = Deno.env.get("HOME"); | ||
const shell = Deno.env.get("SHELL") || null; | ||
|
||
if (!username || !homedir) throw codes.SYSERR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I throw notImplemented(SEE_GITHUB_ISSUE);
here too? node does a system error when those aren't set
uid: -1, | ||
gid: -1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we warn about uid/gid in the cli?
Awesome, I wasn't sure if that or would cut in the next version hence the quick minimalistic one. Great to hear. I'll close this one |
Most packages in node uses os.userInfo to read username, shell or homedir. this changes still causes an exception on trying to read
uid
andgid
and supports onlyutf-8
option for now but that's a start.impact
While this isn't an accurate implementation, some npm packages such as https://www.npmjs.com/package/atomically (which is used by remix and many other projects) depends on it and would make a large chunk of the npm ecosystem workable, making deno more adoptable
this is linked to #17850
This feels like a "poorman solution" but if any insights on integrating [gu]id is provided I would gladly try my best to address it.
propositions:
something like
deno run --unstable-os-user-info npm:<package>