3 ms·
Which one allows to import multiple versions of a lib/module/package with different versions? (Not primarily but also an issue of the package manager.)
by stewbrew 10y ago
Which one allows to import multiple versions of a lib/module/package with different versions? (Not primarily but also an issue of the package manager.)
- olalonde 10y agoNpm allows that.
- moosingin3space 10y agoHow do different versions of the same package interact with npm? Since JS is a dynamic language, it seems that there could be problems if a function in one version of a package returned a value which was then fed to a function in a different version.
- stewbrew 10y agoYou typically import it like: var foo = require('foo'); The lib's functions are accessed solely via the foo object. There is no interaction when different libs require different versions of a lib because the access the lib via different objects/modules. This actually is the one aspect of javascript I wish other languages would copy.