Tom MacWright

tom@macwright.com

node-fresh

Update: This post was published in 2012. As of 2017,
  • node-fresh is no longer developed. LiveReload-based solutions have become more popular, and frameworks like create-react-app and next.js support live reloading by default.

node-fresh is a tiny, simple solution to the age-old problem of laboriously refreshing a browser page every time you tweak a simple static site.

~/Sites/tmcw.github.com⇾ fresh .
add to your page:

	<script src="http://127.0.0.1:1337/"></script>

watching for changes in 1 directories...

It was spurred on by a recent Project it Yourself redesign - I noticed that LiveReload had acquired features and was now distributed on the mac store, and felt like the parts that I wanted were easy to build.

Install it with:

npm install -g node-fresh

And it was simple: node-fresh is dependency-free, and around 30 sloc. It provides a single binary, fresh, that you give a list of directories to as arguments.