One, as long as both imports resolve to the same file path
One. Node caches a module by its resolved filename. The top-level code runs once, and both files share the same Map. So "Two, because each importing file runs the module again" is wrong.
The caveat is how the path resolves. These cases can create separate instances:
• two copies of a package in node_modules
• different spellings of the path on a case-insensitive file system
Read more