Hacker News new | ask | show | jobs
by svckr 3314 days ago
One way is to delete entries from `require.cache`.

Either way you might get a separate instance if npm decided that your module and another module require different version of a given module. These would both be singletons though. Just singletons of instances of different versions of the same module.