isoI
Denoβ€’11mo agoβ€’
9 replies
iso

Deno env vars

In a Deno/Fresh app I have a config file that provides access to env vars, however when I try to run my migrations via

 deno run --env-file=.env db:migrate:latest


which in the deno.json file runs kysely migrate:latest

I am told that Deno is not defined. Is this due to Kysley being a node based lib?

How can I make this work?


export const config: Config = {
    db: {
        host: Deno.env.get('DB_HOST'),
        user: Deno.env.get('DB_USER'),
        password: Deno.env.get('DB_PASSWORD'),
        database: Deno.env.get('DB_NAME'),
        port: parseInt(Deno.env.get('DB_PORT')),
        pool: parseInt(Deno.env.get('DB_POOL_SIZE'))
    }
}
Was this page helpful?