-
Notifications
You must be signed in to change notification settings - Fork 629
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
feat(node): Add support for os.uptime #3052
Conversation
LGTM. Nice work! |
@kamilogorek this should probably be un-drafted given that denoland/deno#17179 got merged? |
@bartlomieju Do you think it's ok to require |
Ah, good point; I forgot about that. Yeah I think it would be preferable to avoid |
I believe there's no need to rerun the tests after internal changes, as they were tested in |
node/os.ts
Outdated
export function uptime(): number { | ||
notImplemented(SEE_GITHUB_ISSUE); | ||
return Deno.osUptime(); |
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.
Please add
// @ts-ignore Deno[Deno.internal] is used on purpose here
const DenoOsUptime = Deno[Deno.internal]?.nodeUnstable?.osUptime || Deno.osUptime;
at the top of the file and use DenoOsUptime()
here
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.
LGTM, thanks @kamilogorek
Dependent on denoland/deno#17179
A part of denoland/deno#17850
This will also allow for out-of-the-box support for
npm:@sentry/node
, ref: getsentry/sentry-javascript#3009 (comment)