Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
How to import config module following ES6 standard not commonJS

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!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

There is not other way for now. I checked in lot of websites. Thank you all.

about 4 years ago · Juan Pablo Isaza Report

0

Just add this line dotenv.config(); and you can then use the values in the .env file using destructuring to get your env values.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!