Re:Show HN: Nsynjs – JS engine with stoppable threads and wi...
by svckr on Wednesday May 24, 2017 @03:35AM
(#14408162)
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.
Re:Show HN: Nsynjs – JS engine with stoppable threads and wi...
by BinaryIdiot on Wednesday May 24, 2017 @01:27PM
(#14411763)
It is, I only meant that's a way it can be handled not that it wasn't common or anything.
How would you even make it _not_ return a singleton? I thought that was default.