Running melonJS in node.js

Following some discussion here on how to support isomorphic Apps in melonJS, we made some changes since the 10.7.0 release to be more node.js friendly. Not only all reference to the global window has been replace by globalThis that provides a standard way of accessing the global this value across environments (including node.js). But as well, the whole bootstrap has been modified to only initialise elements based on the target platform support.

melonJS will still need (for now) things like jsdom, node-canvas or optionally headless-gl to shim the missing components when running a proper game, but at least now it won’t crash when loading the engine in node.js.

While we have not used it yet in an official project (the exercise was limited in having melonJS loading without crashing), this thread is to collect your feedback on project and experience in using melonJS in node.js, so that the community can benefits from it : What additional script did you use, what part of jsdom or canvas did you use, or what other components you had to add to make it work, we are interested to know !

– the melonsJS team