RequireJS is a JavaScript file and module loader. We usually use it in browser applications, but it can be used in Node.js applications as well.
The good thing about RequireJS is that it can load files and modules asynchronously. Asynchronous loading makes the web page appear on the screen faster. It basically postpones loading files to whenever they are needed.
By doing asynchronous loading, web pages start with smaller files, and fewer network calls, resulting in quicker startups.
The example project can be found at https://github.com/polatengin/B05277/tree/master/Chapter18/2-GettingStartedRequireJs.
If we're developing a large application and it has tens of JavaScript files, it's hard to maintain dependency and load the right file in the right place, for example, in e-commerce applications such as the ones we have; the shoppingCart.js, product.js, and...