feat: stabilize Deno.uid() and Deno.gid() (#16424)

Closes https://github.com/denoland/deno_std/issues/2791
This commit is contained in:
Colin Ihrig 2022-11-09 09:46:50 -05:00 committed by GitHub
parent 0500aa1f71
commit c36496b3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 38 deletions

View file

@ -4950,4 +4950,32 @@ declare namespace Deno {
* @category Timers
*/
export function unrefTimer(id: number): void;
/**
* Returns the user id of the process on POSIX platforms. Returns null on Windows.
*
* ```ts
* console.log(Deno.uid());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function uid(): number | null;
/**
* Returns the group id of the process on POSIX platforms. Returns null on windows.
*
* ```ts
* console.log(Deno.gid());
* ```
*
* Requires `allow-sys` permission.
*
* @tags allow-sys
* @category Runtime Environment
*/
export function gid(): number | null;
}