My project structure look like this:
|-project
|-src
|-index.ts
|-.env
in index.ts I'm trying to load environment variables:
import dotenv from 'dotenv';
dotenv.config();
I've also tried with
dotenv.config({
path: __dirname+"/../.env"
});
file .env itself is surely ok, where is the mistake? Thank for help
command that I'm running is ts-node ./src/index.ts
edit: I'm accesing values using expression like process.env.DB_CONNECT
.env file
DB_CONNECT=someValue
TOKEN_KEY=someValue