JSPM

  • Created
  • Published
  • Downloads 142
  • Score
    100M100P100Q76941F

Simple Web Server with live/autoreload features without browser extensions.

Package Exports

  • simple-autoreload-server

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-autoreload-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

simple-autoreload-server Build Status

A simple Web server on Node.js with Live/Autoreload feature.

  • Reload statically on update the html files
  • Refresh dynamically on update the files like css, js, png, and etc.
  • No browser extensions (but the WebSocket) are needed.

Command Line Usage

autoreload-server [options] [root-dir] [port]

Command Line Options

option default description
--root, -d <param> . set base directory to publish.
--port, -p <param> 8080 set port to listen (http).
--list-directory, -l true enable directory listing.
--watch, -w <param> /^/ regex pattern of file to watch.
--watch-delay <param> 1 time to delay before fireing watch event (in ms).
--verbose, -v false enable verbose log.
--recursive, -r true watch directory recursively. (may take a while at startup)
--follow-symlink, -l false follow symbolic-link. (it affects only when the resursive option specified.
--force-reload, -f <param> regex pattern for file forced to reload page.
--broadcast-delay <param> 0 time to delay before broadcasting file update event (in ms).
--no-default-script false disable injection of default client script.
--inject-file, -I <param> set path to additional file to be injected.
--inject-method, -M <param> p specify the method [prepend or append]
--inject-match-text, -T <param> specify the pattern where to inject
--inject-match-file, -F <param> specify the pattern for file to inject
--version, -V show version
--help, -h show help

Example

autoreload-server -w "\\.(html|css|js)" ./site-files 8008

Module Usage (Example)

var launcher = require('simple-autoreload-server');

var server = launcher({
  port: 8008,
  root: './',
  listDirectory: true,
  watch: /\.(png|js|html|json|swf)$/i,
  forceReload: [/\.json$/i, "static.swf"]
});

Options

See 'src/lib/options.ls' for details of options.

Version

0.0.12

Installation

install this package via 'npm'.

npm install simple-autoreload-server

License

MIT License