diff options
author | Kamil Ogórek <kamil.ogorek@gmail.com> | 2022-12-27 00:16:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-27 00:16:12 +0100 |
commit | 7ce2b58bcf412924464578f3469c210b34894c8b (patch) | |
tree | 571ef978ec8ff59bc2f3c229ea44b0786251e6b9 /runtime/permissions/mod.rs | |
parent | a67fd3e23e6965ce0bf25e19e5467bc5cc538d23 (diff) |
feat(unstable): Add "Deno.osUptime()" API (#17179)
This PR adds support for `Deno.osUptime` which reports number of seconds
since os was booted. It will allow us to be compatible with Node's `os.uptime` -
https://nodejs.org/api/os.html#osuptime
Partially based on
https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
Diffstat (limited to 'runtime/permissions/mod.rs')
-rw-r--r-- | runtime/permissions/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index 5b2af0e0f..ce4984ee1 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -309,7 +309,7 @@ pub struct SysDescriptor(pub String); pub fn parse_sys_kind(kind: &str) -> Result<&str, AnyError> { match kind { - "hostname" | "osRelease" | "loadavg" | "networkInterfaces" + "hostname" | "osRelease" | "osUptime" | "loadavg" | "networkInterfaces" | "systemMemoryInfo" | "uid" | "gid" => Ok(kind), _ => Err(type_error(format!("unknown system info kind \"{}\"", kind))), } |