Closed bgarel closed 6 years ago
Sorry for not answering earlier, I was a bit too busy lately ...
Current release version of v8js doesn't have that feature (unfortunately).
I started working on cleaning up the require-code a while back and added support for exactly that global
variable back then with commit https://github.com/stesie/v8js/commit/1ae99d2ab945b0900a81c106a26ea83b18df0d11
... maybe you'd like to try that out :)
So to make the subject clear: there is no way to implement a global function or variable with a global object like window in the browser or global in node.js to allow modules to access PHP-Functions, the only way are parameters to a function call?
The nodejs "global" variable is not defined when loading external js script via require(). I have the following error when loading external lib which use the "global" variable : ReferenceError: global is not defined in ....
Is it possible to "share" javascript variables in differents modules loaded with require() ?