0.2.5 • Published 7 years ago
plug-live-reload v0.2.5
Plug Live Reload
PLR is a simple tool to auto-reload a script on plug.dj when you save the file in your editor, intended to make development easier.
Example:
How it works
It works by simply connecting to a WebSocket server running on your machine in node,
the node app watches the specified file for changes, and pushes the file contents
to the script running on plug.dj via the websocket, which then wraps it in a <script> </script>
tag in the page
Usage
Firstly, you need to have node.js installed
- Install the package globally using
npm install --global plug-live-reload
- Start the server by typing
plr --file path/to/file.js
, you can specify another port with the--port
option (Default is 1337) - Load the client script on plug either by adding the following bookmark to you bookmarks bar, using the userscript here or by hosting it yourself from this repo.
- Type
/plron
in plug to connect to the socket server, If you've changed the port from the default port, use/plron <port>
to specify a port. PLR will rememember the last port you used, and use it the next time you type/plron
without any arguments.
Bookmark:
javascript:(function(){$.getScript('https://cdn.rawgit.com/Dazzuh/plug-live-reload/b693cd87/client/client.js');}());
Notes
You can disconnect from the server and unload the script by typing /plroff
"file" in config.json is the file the server will watch for changes and load in plug.dj.