An open API service indexing awesome lists of open source software.

https://github.com/angeal185/socketio-live-reload

in browser live reload using socketIO
https://github.com/angeal185/socketio-live-reload

live-reload nodejs socket-io socketio watch-files

Last synced: about 2 months ago
JSON representation

in browser live reload using socketIO

Awesome Lists containing this project

README

          

# socketio-live-reload
in browser live reload using socketIO

### Installation

npm:
```sh
$ npm install socketio-live-reload --save-dev
```

### API

#### server-side

```js

// defaults ~ created in your cwd automatically on
// first run and can be edited in ./SLR.json

{
"server":{ // slr server config
"port": 8888,
"cache": "no-cache"
},
"watch": ["./*"], //watched files
"options": {
"ignored": [ //ignored files
"./node_modules/*"
],
"interval": 100,
"depth": 99,
"ignoreInitial": false,
"followSymlinks": true,
"cwd": "./",
"disableGlobbing": false,
"usePolling": true,
"binaryInterval": 300,
"alwaysStat": false,
"awaitWriteFinish": {
"stabilityThreshold": 2000,
"pollInterval": 100
},
"ignorePermissionErrors": false,
"atomic": 100
},
"io": { //socket.io options
"pingInterval": 10000,
"pingTimeout": 5000,
"transports": [
"polling",
"websocket"
]
}
}

//demo
const slr = require('socketio-live-reload');

slr.init();

```

#### client-side

```js
//defaults

{
port: 8888, // socket.io server port
URL: 'http://localhost', // socket.io server url
reload: true, // auto reload enabled
reloadTime: 1000, // time before reload
debug: true //debug toolbar
}

/**
* sync ~ init SLR
* @param {object} config ~ optional client side config
* @param {function} cb ~ optional callback
**/

slr.init(config, cb)

```

```html

slr.init()
```