Skip to content

Instantly share code, notes, and snippets.

@liammclennan
Created June 1, 2012 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liammclennan/2849583 to your computer and use it in GitHub Desktop.
Save liammclennan/2849583 to your computer and use it in GitHub Desktop.
Snap - Automatic browser reloading

return to withouttheloop.com

This file is a fantasy readme for an tool that doesn't exist yet. I wrote it in an attempt to apply readme driven development. The idea is to force yourself to define a vision for your product/tool/whatever before starting to build anything.

Snap

snap is a tool that automatically reloads your browser based on filesystem events. For example, it can be configured to automatically reload the webpage you are working on when any of your html files are modified.

snap({
  '.': /.+\.html/
});

Usage

Create a snap script (as above) and start the server:

node snap mysnapscript.js

Add the following script to the page that you want auto-reloaded:

<script src="http://localhost:9876/snap.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment