Is there such a thing a 'domain' variables in node.js? <p>Is there a way to set a variable globally in node.js on a per domain-like basis? I say domain-like because at first I though of creating a domain and attaching a value to it so any piece of code that runs inside the domain will have access to it. The code would have looked similar to this:</p> <pre><code>var myDomain = domain.create() myDomain.someVariable = 1; myDomain.run(function () { console.log(domain.getCurrentDomain().someVariable); }); </code></pre> <p>Unfortunately, that's not how domains work and can be used. Is there something similar to this that can be done however?</p> <p>Having nested scopes is not a solution because there's multiple files involed.</p> <p>Thanks</p>