1.0.13 • Published 8 years ago

automagic-systemjs-server v1.0.13

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

A SystemJS hot module replacer to loads file changes without full page refreshes.

#Usage Build Status

##1. Install npm install --save-dev automagic-systemjs-server

##2. Launch the server

var automagic = require('automagic-systemjs-server');
automagic.init(options);

###init(options) ####port socket.io server port to start on

defaults 3912

####origins socket.io CORS

default '*:*'

####newConnectionCallback function invoked on a new connection

default console.log('...', new Date());

##3. Publish automagic.fileChanged event to clients

gulp.watch(['*.js', '!node_modules/**'])
        .on('change', function (e) {
            var data = {
                fileName: path.basename(e.path)
            };
            io.emit(automagic.fileChanged, data);
        });

To retrieve theio instance you can store it on initialisation var io = automagic.init() or use the public getter automagic.io

##Server setup complete! Continue with the automagic client

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

0.0.1

8 years ago