xxxxxxxxxx
require('dotenv').config({ path: '/custom/path/to/.env' })
xxxxxxxxxx
import dotenv from 'dotenv';
dotenv.config();
console.log(process.env.MY_KEY);
xxxxxxxxxx
// yarn add ts-dotenv
import { load } from 'ts-dotenv';
const env = load({
TEST: Boolean,
});
console.log(env.TEST);