⚙️ Env Vars

Manage Environment Variables

How to Access Environment Variables

file_type_typescript app.ts
const code = Deno.env.get('KILLCODE')

Set Environment Variables with Dotenv

.env
KILLCODE=hello
deno.json
{
  "tasks": {
    "dev": "deno run --env app.ts"
  }
}

Set Environment Variables in a Task

deno.json
{
  "tasks": {
    "dev": "export KILLCODE=hello && deno run app.ts"
  }
}

Questions? Let's chat

Open Discord