Skip to content

Serve the contents of a directory and livereload those that change

Notifications You must be signed in to change notification settings

jmorrell/barkeep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

barkeep

Serve the files in the current directory and update the browser when they change without refreshing.

No plugins. No app. No scripts.

screencast

Installation

npm install -g barkeep

CLI Usage

In your project's directory

barkeep

If you need to serve on a custom port you can do that too

barkeep -p 8080

By default, if there is an index.html in the current directory, it will open in your default browser. You can prevent this behavior by

barkeep --silent

Module Usage

You can also require and use barkeep programatically in node.

var barkeep = require('barkeep');

barkeep(directory).listen(staticPort, livereloadPort, onListen);

All arguments to listen are optional. You can pass only the callback if you'd like.

barkeep(directory).listen(onListen);

Notes

This works by automagically inserting a liverelead script right before the close of the body element. This might not work for all set ups. You can insert the script manually by adding this tag to your HTML:

<script src="http://localhost:35729/livereload.js"></script>

This uses tiny-lr and gaze behind the scenes.

About

Serve the contents of a directory and livereload those that change

Resources

Stars

Watchers

Forks

Packages

No packages published