How to use global.settings:
GitHub: hahaxixi/FlappyFrog
3 4 5 6 7 8 9 10 11 12
var global = require('global'); var sounds = require('sounds'); var scene = require('scene'); var utils = require('utils'); var settings = global.settings; function preload() { global.phaserGame.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL; global.phaserGame.stage.scale.setScreenSize(true);
How to use global.require:
GitHub: yields/instrument
116 117 118 119 120 121 122 123 124 125
* * @api private */ Instrument.prototype.replace = function(){ var mods = global.require.modules; var mod = this.mod; var src = mod.instrumented; mods[mod.key] = Function('exports', 'require', 'module', src); };
How to use global.localStorage:
GitHub: treasure-data/td-js-sdk
95 96 97 98 99 100 101 102 103
* td.trackEvent('willbetracked') // will send td_ip and td_client_id; td_global_id will also be sent if set. */ exports.setSignedMode = function setSignedMode () { if (this.client.storeConsentByLocalStorage) { if (!misc.isLocalStorageAccessible()) return this global.localStorage.setItem(SIGNEDMODECOOKIE, 'true') } else { setCookie(this.client.storage, SIGNEDMODECOOKIE, 'true') }
30
65
93
See more examples
How to use global.phaserGame:
GitHub: hahaxixi/FlappyFrog
7 8 9 10 11 12 13 14 15 16
var settings = global.settings; function preload() { global.phaserGame.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL; global.phaserGame.stage.scale.setScreenSize(true); sounds.preload(); scene.preload(); }