Updating dotenv `load` and `loadSync` with assertion + type inference
Open
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 681
- PR merge metrics
- No merged PRs in 30d
Description
Thoughts on updating the `load` and `loadSync` functions such that an `assertExists` option could be supplied (which would then inform the returned env record)?
```ts
import { load } from "@std/dotenv"
const env = await load({
assertExists: ["STRIPE_API_KEY", "OPENAI_API_KEY", "DATABASE_URL"]
})
env satisfies {
STRIPE_API_KEY: string
OPENAI_API_KEY: string
DATABASE_URL: string
}
```
Contributor guide
Assessment
This issue has not been assessed yet.