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

284
Vistas
What's better between importing the whole module multiple times or using a single instance throughout the App?

I've been working with NodeJS for a while now. I got doubt while optimizing my code that would it be better if I import only required functions in my script or wouldn't it bring any difference in importing the whole module. Also, would creating an instance of axios in my React app and then using it elsewhere would have the same effect importing it in every single file?

Also I'd like to know what happens to the used functions when the scripts are compiled? Is the script optimized to a single function or a tree of depending functions?

Maybe the difference would be insignificant but I'd still like to know the which ones the efficient one.

about 4 years ago · Juan Pablo Isaza
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