alepha@docs:~/docs/reference/primitives$
cat $env.md1 min read
#$env
#Import
typescript
1import { $env } from "alepha";
#Overview
Get typed values from environment variables.
#Examples
ts
1const alepha = Alepha.create({ 2 env: { 3 // Alepha.create() will also use process.env when running on Node.js 4 HELLO: "world", 5 } 6}); 7 8class App { 9 log = $logger();10 11 // program expect a var env "HELLO" as string to works12 env = $env(t.object({13 HELLO: t.text()14 }));15 16 sayHello = () => this.log.info("Hello ${this.env.HELLO}")17}18 19run(alepha.with(App));