Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@m59/reload-client

1.0.3 • Public • Published

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()

Install

npm i @m59/reload-client

DownloadsWeekly Downloads

8

Version

1.0.3

License

CC0-1.0

Last publish

Collaborators

  • avatar