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

https://github.com/francescozoccheddu/reload-please

Lightweight server and client script to trigger a browser page reload
https://github.com/francescozoccheddu/reload-please

browser nodejs reload typescript websocket

Last synced: 2 months ago
JSON representation

Lightweight server and client script to trigger a browser page reload

Awesome Lists containing this project

README

          

# reload-please

Lightweight server and client script to trigger a browser page reload.

## Installation

Run:

```shell
npm i @francescozoccheddu/reload-please
```

## Usage

### Server

```javascript
import { Server } from "@francescozoccheddu/reload-please";

const server = new Server();
server.start();
// [...]
server.reload();
// [...]
server.stop();
```

### Client

```javascript
import { Client } from "@francescozoccheddu/reload-please";

const client = new Client();
client.start();
// [...]
client.stop();
```

> [!TIP]
> You can also use `server.clientScript` or `getClientScript()` to inject the client code server-side, on the fly.

## Build

Run:

```shell
npm run build
```