I know that npm libraries, when installed, can install multiple versions of the same library in a hierarchical tree, like this:
a@0.1.0
-> b@1.0
-> c@2.0
-> b@2.0
In the above, package a at version 0.1.0 is pulled in, and its dependencies b@1.0 and c@2.0. Similarly, c@2.0's dependency is
pulled in, which is b@2.0.
I have heard from someone that, even though package b is installed at two different versions, only one of them is actually loaded into memory and used. I have also heard that this may or may not be the case for node deployments of javascript versus browser deployments.
So my question is: Is it true that only one package of b is loaded into memory? If it is, is this true for both node and browser, or are there differences?