method Deno.Env.toObject
Env.toObject(): { [index: string]: string; }
Returns a snapshot of the environment variables at invocation as a simple object of keys and values.
Deno.env.set("TEST_VAR", "A"); const myEnv = Deno.env.toObject(); console.log(myEnv.SHELL); Deno.env.set("TEST_VAR", "B"); console.log(myEnv.TEST_VAR); // outputs "A"
Requires allow-env
permission.
{ [index: string]: string; }