Question: Which of the following is a key reason you should use node packages when building a basic Node app?
- Node packages allow you to use pre-built code for specific functionalities of your integration.
- Node packages allow you to re-write basic JavaScript commands to be more complex.
- Node packages allow you to write your code more quickly.
- Node packages allow you to package your own code into one index.js file.
Explanation
Node packages let developers reuse existing, tested code instead of building every function from scratch. In an Amazon Ads API integration, packages can support tasks such as HTTP requests, environment-variable handling, authentication helpers, and server setup. This keeps the application focused on integration logic rather than rebuilding common functionality. Packages are installed into the project and imported where their functionality is needed. They improve development efficiency by supplying pre-built capabilities for specific needs.
Why the other options are incorrect
Rewrite commands This is incorrect because packages provide reusable functionality, not a way to make basic JavaScript commands more complex.
Write code quickly This may be a result, but the key reason is access to pre-built functionality.
One index.js file This is incorrect because packages do not package all project code into a single file by default.
Source for verification
https://docs.npmjs.com/about-packages-and-modules
https://nodejs.org/api/modules.html
The answer(s) to the question is highlighted in the BOLD text above. You can also find more questions and answers related to the exams on the "Integrating With HubSpot I: Foundations" page.
