# @elderjs/plugin-browser-reload

> Reload your browser when your Elder.js server restarts.

Latest version **1.3.10** (published 2022-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @elderjs/plugin-browser-reload
pnpm add @elderjs/plugin-browser-reload
yarn add @elderjs/plugin-browser-reload
bun add @elderjs/plugin-browser-reload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.10 |
| Published | 2022-04-29 |
| First published | 2020-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Author | Nick Reese |
| Maintainers | nickreese, lukeed |
| Keywords | elder.js, elderjs, svelte, ssg, static, browser, reload, dev |

## Links

- npm: https://www.npmjs.com/package/@elderjs/plugin-browser-reload
- Repository: https://github.com/Elderjs/plugins
- Homepage: https://elderguide.com/tech/elderjs/
- Issues: https://github.com/Elderjs/plugins/issues
- npm.io page: https://npm.io/package/@elderjs/plugin-browser-reload

## Dependencies (1)

- [socket.io](https://npm.io/package/socket.io.md) ^2.3.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.3.10 (latest) — 2022-04-29
- 1.3.9 — 2022-04-13
- 1.3.8 — 2022-03-25
- 1.3.7 — 2022-03-07
- 1.3.6 — 2022-03-04
- 1.3.5 — 2022-03-04
- 1.3.4 — 2021-10-08
- 1.3.3 — 2021-10-08
- 1.3.2 — 2021-09-25
- 1.3.1 — 2021-09-13
- 1.3.0 — 2021-08-10
- 1.2.1 — 2021-08-10
- 1.2.0 — 2021-07-30
- 1.1.6 — 2021-07-02
- 1.1.5 — 2021-07-01
- … 40 more at https://npm.io/package/@elderjs/plugin-browser-reload/versions

## README

# Elder.js: Browser Reload

Designed to work with the [Elder.js Template](https://github.com/Elderjs/template/) and integrate browser reloading.

It works by adding a websocket on bootstrap. It then sets up a listener to that websocket on the client.

When the server is restarted due to a code change, the browser will restart as well.

## Install

```bash
npm install --save @elderjs/plugin-browser-reload
```

## Config

Once installed, open your `elder.config.js` and configure the plugin by adding `@elderjs/plugin-browser-reload` to your plugin object.

```javascript
plugins: {
  '@elderjs/plugin-browser-reload': {} // activates the plugin
}
```

## Customizing the Defaults

Below are the default settings of the plugin. You can adjust them to your needs.

```javascript
plugins: {

  '@elderjs/plugin-browser-reload': {
    origin: 'http://localhost',
    port: 8080, // the port the websocket server should run on.
    delay: 200, // the delay in ms the browser should wait after the server disappears.
    preventReloadQS: 'noreload', // if 'noreload' is in the query string it won't reload that page. Good for CSS editing in the browser.
    retryCount: 50, // number of tries the browser will check to see if the server is up before giving up.
    reload: true, // complete reload of the page. Set to false to use fetch to replace the document.
  },

}
```

---
_Source: https://npm.io/package/@elderjs/plugin-browser-reload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
