summaryrefslogtreecommitdiff
path: root/js/lib.deno_runtime.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib.deno_runtime.d.ts')
-rw-r--r--js/lib.deno_runtime.d.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/lib.deno_runtime.d.ts b/js/lib.deno_runtime.d.ts
index d0a720769..780503106 100644
--- a/js/lib.deno_runtime.d.ts
+++ b/js/lib.deno_runtime.d.ts
@@ -44,6 +44,16 @@ declare namespace Deno {
export function env(): {
[index: string]: string;
};
+ /** Returns the value of an environment variable at invocation.
+ * If the variable is not present, `undefined` will be returned.
+ *
+ * const myEnv = Deno.env();
+ * console.log(myEnv.SHELL);
+ * myEnv.TEST_VAR = "HELLO";
+ * const newEnv = Deno.env();
+ * console.log(myEnv.TEST_VAR == newEnv.TEST_VAR);
+ */
+ export function env(key: string): string | undefined;
/**
* Returns the current user's home directory.
* Requires the `--allow-env` flag.