diff --git a/client/package.json b/client/package.json index 56620c1..f56912a 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "sacrificial-socket", - "version": "1.1.2", + "version": "1.1.3", "description": "Client javascript for use with the Sacrificial-Socket service", "keywords": [ "websocket", @@ -11,5 +11,6 @@ "files": [ "sacrificial-socket.js", "ng-ss.js" - ] -} + ], + "main": "sacrificial-socket.js" +} \ No newline at end of file diff --git a/client/sacrificial-socket.js b/client/sacrificial-socket.js index 1e3abba..a3fdc50 100644 --- a/client/sacrificial-socket.js +++ b/client/sacrificial-socket.js @@ -1,4 +1,10 @@ -(function(window){ 'use strict'; +if(typeof window === 'undefined'){ + var window = {}; +} +if(typeof module === 'undefined'){ + var module = {}; +} +(function(window, module){ 'use strict'; /** * SS is the constructor for the sacrificial-socket client * @@ -239,4 +245,5 @@ }; window.SS = SS; -})(window); \ No newline at end of file + module.exports = SS; +})(window, module); \ No newline at end of file diff --git a/examples/not-so-simple-examples/grpc-multihome/webroot/js/sacrificial-socket.js b/examples/not-so-simple-examples/grpc-multihome/webroot/js/sacrificial-socket.js index 1e3abba..a3fdc50 100644 --- a/examples/not-so-simple-examples/grpc-multihome/webroot/js/sacrificial-socket.js +++ b/examples/not-so-simple-examples/grpc-multihome/webroot/js/sacrificial-socket.js @@ -1,4 +1,10 @@ -(function(window){ 'use strict'; +if(typeof window === 'undefined'){ + var window = {}; +} +if(typeof module === 'undefined'){ + var module = {}; +} +(function(window, module){ 'use strict'; /** * SS is the constructor for the sacrificial-socket client * @@ -239,4 +245,5 @@ }; window.SS = SS; -})(window); \ No newline at end of file + module.exports = SS; +})(window, module); \ No newline at end of file diff --git a/examples/not-so-simple-examples/redis-multihome/webroot/js/sacrificial-socket.js b/examples/not-so-simple-examples/redis-multihome/webroot/js/sacrificial-socket.js index 1e3abba..a3fdc50 100644 --- a/examples/not-so-simple-examples/redis-multihome/webroot/js/sacrificial-socket.js +++ b/examples/not-so-simple-examples/redis-multihome/webroot/js/sacrificial-socket.js @@ -1,4 +1,10 @@ -(function(window){ 'use strict'; +if(typeof window === 'undefined'){ + var window = {}; +} +if(typeof module === 'undefined'){ + var module = {}; +} +(function(window, module){ 'use strict'; /** * SS is the constructor for the sacrificial-socket client * @@ -239,4 +245,5 @@ }; window.SS = SS; -})(window); \ No newline at end of file + module.exports = SS; +})(window, module); \ No newline at end of file diff --git a/examples/simple-examples/chat/webroot/js/sacrificial-socket.js b/examples/simple-examples/chat/webroot/js/sacrificial-socket.js index 1e3abba..a3fdc50 100644 --- a/examples/simple-examples/chat/webroot/js/sacrificial-socket.js +++ b/examples/simple-examples/chat/webroot/js/sacrificial-socket.js @@ -1,4 +1,10 @@ -(function(window){ 'use strict'; +if(typeof window === 'undefined'){ + var window = {}; +} +if(typeof module === 'undefined'){ + var module = {}; +} +(function(window, module){ 'use strict'; /** * SS is the constructor for the sacrificial-socket client * @@ -239,4 +245,5 @@ }; window.SS = SS; -})(window); \ No newline at end of file + module.exports = SS; +})(window, module); \ No newline at end of file