Skip to content

Instantly share code, notes, and snippets.

View javierfernandes's full-sized avatar

Javier Fernandes javierfernandes

  • Buenos Aires, Argentina
View GitHub Profile
@crisu83
crisu83 / phaser.js
Created June 25, 2014 07:03
Wrapper module for running Phaser.js on Node.js.
// this is an ingenius hack that allows us to run Phaser without a browser
// ... and yes, it took some time to figure out how to do this
var Canvas = require('canvas')
, jsdom = require('jsdom')
, document = jsdom.jsdom(null)
, window = document.parentWindow
, Phaser;
// expose a few things to all the modules