Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Using in node.js or io.js

Ivo Georgiev edited this page Jul 29, 2015 · 1 revision

Get it running

You can use WebChimera.js easily with node.js, but when installing webchimera.js the default runtime is nw.js. To build for node.js, you have to run:

cd node_modules/webchimera.js
export npm_config_wcjs_runtime="node"
export npm_config_wcjs_runtime_version="0.12.2" # or your node.js version
npm install

WARNING: Currently we have a critical bug with Node.js where initiating WebChimera.js for Node.js, see this issue for a workaround.

Quirks

In node.js, by default the player object will be garbage collected, even if .onFrameReady, .onFrameSetup or other callbacks are assigned. To work around this, use

global.player = player

Or reference it somewhere else.