diff options
Diffstat (limited to 'cli/js/os.ts')
-rw-r--r-- | cli/js/os.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/js/os.ts b/cli/js/os.ts index 275dbdf1d..d3c0d1b72 100644 --- a/cli/js/os.ts +++ b/cli/js/os.ts @@ -11,6 +11,14 @@ import * as util from "./util.ts"; export function isTTY(): { stdin: boolean; stdout: boolean; stderr: boolean } { return sendSync(dispatch.OP_IS_TTY); } +/** Get the loadavg. + * Requires the `--allow-env` flag. + * + * console.log(Deno.loadavg()); + */ +export function loadavg(): number[] { + return sendSync(dispatch.OP_LOADAVG); +} /** Get the hostname. * Requires the `--allow-env` flag. |