Add Deno.hostname() (#3032)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2019-09-27 16:09:42 -07:00 committed by Ryan Dahl
parent d36391ad20
commit 6efca6d1a1
9 changed files with 60 additions and 1 deletions

View file

@ -22,6 +22,12 @@ declare namespace Deno {
stdout: boolean;
stderr: boolean;
};
/** Get the hostname.
* Requires the `--allow-env` flag.
*
* console.log(Deno.hostname());
*/
export function hostname(): string;
/** Exit the Deno process with optional exit code. */
export function exit(code?: number): never;
/** Returns a snapshot of the environment variables at invocation. Mutating a