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

286
Visualizações
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 à 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