This projects shows that, in node.js, the "same" object imported from two different versions of a same package is actually different.
base
, both in version 1.0.0 and 1.1.0 simply exports an empty object.a
is a package that importsbase
1.0.0 and simply exports it.b
is a package that importsbase
1.1.0 and simply exports it.main
is the executable. It importsa
andb
two times each, then prints whether the two values imported froma
(i.e.base
1.0.0) are the same, whether the two values imported fromb
(i.e.base
1.1.0) are the same and whether the object imported froma
is the same as the one imported fromb
.
This is to show that:
- The object imported from
a
is always the same: it'sbase
1.0.0. - The object imported from
b
is always the same: it'sbase
1.1.0. - The object imported from
a
is different from the one imported fromb
, in spite of coming from a package with the same name.
To run this test, enter the main
directory and run node index.js
.