Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
in nodejs which the best practice to use class based (using import) or function based ( using require) programming

I'm learning Nodejs and express. I've got some doubts about it, I don't understand which is the best practice for nodejs using import or require

enter image description here

enter image description here

almost 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The only "best practice" is what your organization has set.

The only real downfall, is developers on your team not knowing how to write modules for ES6.

I have done countless code reviews where the developer is using exports.func() and then importing it in another file.

Unless your team is seasoned and not new to JS, then pick one and don't combine them. Since you mentioned you are new, stick with CJS.

Reading materials: syntax differences between CJS & ES6 modules

almost 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda