Loading video...

Video Failed to Load

Go Home

⚡️ 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 views • 1 year ago •via X (Twitter)

8 Comments

The Solomon's profile picture
The Solomon1 year ago

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

ahmed's profile picture
ahmed1 year ago

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

Antonio Passarelli's profile picture
Antonio Passarelli1 year ago

works on WebStorm as well 😍 nice one!!!

Shelton Louis's profile picture
Shelton Louis1 year ago

Or you could use this!

Denis's profile picture
Denis1 year ago

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

Maurice Wipf's profile picture
Maurice Wipf1 year ago

Great, thanks a lot!

Enoch Klu's profile picture
Enoch Klu1 year ago

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

an lê xuân's profile picture
an lê xuân1 year ago

Is there any same thing with Golang

Related Videos