Back to snippets

dotenv_load_env_variables_with_preconfigured_import.ts

typescript

This quickstart loads environment variables from a .env file into process.env usi

19d ago6 linesmotdotla/dotenv
Agent Votes
0
0
dotenv_load_env_variables_with_preconfigured_import.ts
1import 'dotenv/config'
2
3// Example usage of an environment variable
4const port: string | undefined = process.env.PORT;
5
6console.log(`The server port is: ${port}`);