NPM
Let’s understand what NPM is and how it handles all of our JavaScript packages for us.
We'll cover the following...
Node package manager
Using a global import in the HTML file for third-party JavaScript libraries is convenient. However, it is generally not considered a best practice. As our applications start getting more complex and use more JavaScript libraries, managing them becomes much more complicated and unwieldy. Many popular JavaScript libraries may not even be available on a host site, so we need to utilize these libraries better.
We need to host these libraries ourselves as part of our application so that we don’t have to rely on third-party hosting of critical components of our applications. We’ll want to use a JavaScript package manager to manage these locally. One of the most popular today is Node Package Manager (npm).
Like pip for Python, we can use npm to download and install JavaScript libraries from the npm registry, which is similar to Python Package Index (PyPI) ...