Skip to main content
Deno.Env.has - Deno documentation
method Deno.Env.has
allow-env
Env.has(key: string): boolean

Check whether an environment variable is present or not.

Deno.env.set("SOME_VAR", "Value");
Deno.env.has("SOME_VAR");  // outputs true

Requires allow-env permission.

Parameters

key: string

Return Type

boolean