@m59/reload-client
v1.0.3
Published
Client-side script to respond to signals from @m59/reload-server. Can reload the page and refresh css and images.
Downloads
4
Maintainers
Readme
Reload Client
Client-side script for triggering page and resource reload over WebSockets.
npm install @m59/reload-client
import Client from '@m59/reload-client'
Client(reloadServerUrl)
JS API
Client(reloadServerUrl, options)
Makes a websocket connection to the given url to listen for reload messages.
options: object
quiet: boolean, false
disable logging to console
- returns:
object
- socket: the WebSocket
- ...helpers
WebSocket API
string JSON
type: string
type of reload- reload
- refreshCSS
- refreshImages
path: string
path to a changed file (for logging)
Helpers
refreshCSS()
import refreshCSS from '@m59/reload-client/refresh-css'
refreshCSS()
refreshImages()
import refreshImages from '@m59/reload-client/refresh-images'
refreshImages()