https://github.com/allnulled/lsw-reloader
Reloader/reloadable tool for LSW
https://github.com/allnulled/lsw-reloader
Last synced: about 1 year ago
JSON representation
Reloader/reloadable tool for LSW
- Host: GitHub
- URL: https://github.com/allnulled/lsw-reloader
- Owner: allnulled
- License: other
- Created: 2025-01-28T02:48:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-24T17:50:20.000Z (about 1 year ago)
- Last Synced: 2025-03-24T18:46:12.797Z (about 1 year ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# lsw-reloader
Reloader/reloadable tool for LSW.
## Installation
```sh
npm i -s @allnulled/lsw-reloader
```
## Importation
From node.js you have to:
```sh
node node_modules/@allnulled/lsw-reloader/reloader.js
```
From html you have to:
```html
```
Then you bind changes on back to refresh on front.
## API
If you don't like to polute your node_modules folder, you can use the API:
```js
const reloader = require("@allnulled/lsw-reloader/reloader.js");
await reloader({
directory: __dirname,
port: 3000,
files: ["**/*.js"],
filter: filepath => true
});
```
And with this, you set up a server, with socket.io, listening for browsers that want to be automatically reloaded, loading `reloadable.js` from the front-side.
## CLI
No CLI right now.