Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

234
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda