I'm mixing some imports and I would like to have all of them using ES6.
import express from 'express';
import dotenv from 'dotenv';
import { PasswordItemDTO } from './api/clients/PasswordCheck/model/passwordItemDTO';
import { PasswordErrorsDTO } from './api/clients/PasswordCheck/model/passwordErrorsDTO';
const config = require('config');
I would like to use the same way, ES6, for the config module which I used commonJS.
I'm using it to retrieve some information: config.get('item'),
There is a possibility to do that? Thanks!
There is not other way for now. I checked in lot of websites. Thank you all.
Just add this line dotenv.config(); and you can then use the values in the .env file using destructuring to get your env values.