Skip navigation
⚡️ Pro Tip: Supercharge process.env with TypeScript!
0:00 / 1:27

⚡️ Pro Tip: Supercharge process.env with TypeScript!

Simon Grimm

@schlimmson17K followers

Visit on X
245 likesDownloadOriginal post

11,584 views

⚡️ 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 👇

8 Comments

Comments from the original post on X (Twitter)

  • The Solomon's profile picture

    @gyan_boateng

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

    4 likes

  • ahmed's profile picture

    @ahmedbgaiess

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

    3 likes

  • Antonio Passarelli's profile picture

    @passantoscience

    works on WebStorm as well 😍 nice one!!!

    3 likes

  • Shelton Louis's profile picture

    @SheltonLouisX

    Or you could use this!

    3 likes

  • Denis's profile picture

    @DMProjectsDev

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

    1 like

  • Maurice Wipf's profile picture

    @mauwi

    Great, thanks a lot!

    1 like

  • Enoch Klu's profile picture

    @gotnoklu

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

  • an lê xuân's profile picture

    @hoh7oht35

    Is there any same thing with Golang