diff options
author | ecyrbe <ecyrbe@gmail.com> | 2020-02-24 14:35:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 08:35:45 -0500 |
commit | fb08cf7005c9dc781d51c7d02ae06060e44d32a3 (patch) | |
tree | 2a74abd57187a1b0015fd1d1873c10399e60fccd /cli/js/os.ts | |
parent | fe9ac35a650dfeea9168fc1cbbbf323b5689fc3b (diff) |
Add missing node os.release() implementation (#4065)
Diffstat (limited to 'cli/js/os.ts')
-rw-r--r-- | cli/js/os.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/js/os.ts b/cli/js/os.ts index d3c0d1b72..7953c2cef 100644 --- a/cli/js/os.ts +++ b/cli/js/os.ts @@ -29,6 +29,15 @@ export function hostname(): string { return sendSync(dispatch.OP_HOSTNAME); } +/** Get OS release. + * Requires the `--allow-env` flag. + * + * console.log(Deno.osRelease()); + */ +export function osRelease(): string { + return sendSync(dispatch.OP_OS_RELEASE); +} + /** Exit the Deno process with optional exit code. */ export function exit(code = 0): never { sendSync(dispatch.OP_EXIT, { code }); |