Package maintenance
JavaScript itself does not provide a native package management system; npm does this job for Node applications. A good package management strategy is, therefore, a key part of a good deployment strategy.
Packages offer the benefit of encapsulation. Running packages are accessible only through the API they've exported. This isolation reduces the number of potential bugs in a system, thus guarding the core functionality from accidental alteration. However, given that (opaque) packages can themselves require other packages as dependencies, the full dependency graph of an application can be difficult for a developer to easily see. For example, if the functionality of a package you have implemented suddenly changes, how do you debug it? Is the error in the package? Is it in one of its dependent packages?
Understanding what is going on in your npm dependency graph is essential when you are deploying Node applications. In this section, we will look at ways to stay up to date on...