正在加载视频...

视频加载失败

⚡️ Pro Tip: Supercharge process.env with TypeScript! Unlock the power of typed .env files and enjoy seamless code completion in TypeScript. 😱 All you need is a simple environment.d.ts with a few lines of code 👇

11,555 次观看 • 1 年前 •via X (Twitter)

8 条评论

The Solomon 的头像
The Solomon1 年前

You still have to declare it at two places though. 😅

ahmed 的头像
ahmed1 年前

Nice but I think it's better to use zod to validate at runtime + have type safery.

Antonio Passarelli 的头像
Antonio Passarelli1 年前

works on WebStorm as well 😍 nice one!!!

Shelton Louis 的头像
Shelton Louis1 年前

Or you could use this!

Denis 的头像
Denis1 年前

I am using zod, but will give it a try 👍

Maurice Wipf 的头像
Maurice Wipf1 年前

Great, thanks a lot!

Enoch Klu 的头像
Enoch Klu1 年前

This is a great tip! But why does adding `export {}` enable the code completion?

an lê xuân 的头像
an lê xuân1 年前

Is there any same thing with Golang

相关视频