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

283
Views
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
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!