1.0.12 • Published 9 years ago

tinylrs v1.0.12

Weekly downloads
9
License
ISC
Repository
github
Last release
9 years ago

tinylrs(tiny-livereload-server)

version Build Status download GitHub issues

nodei

  • Watched files changed ==> reload browser pages
  • A separate livereload server that include both static-file-server(just script) and websocket
  • You don't need install the livereload browser-extension,such as chrome,or other.
  • Just only npm, don't need grunt or gulp or others, don't need download file livereload.js any more
  • Simple and tiny: Only 3 Dependencies: tinylr , gaze, minimist
  • Cross platform Windows, *nix(Mac-OSX or Linux).

1.Installation

$ npm install -g tinylrs

or npm install --save-dev tinylrs

2.Usage

step 1: inject a <script> tag into html (the tail of <body> tag)

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

Just only inject the code.And you don't need download the file(livereload.js)!

step 2: start tinylrs

run in bash directly (need install it globally first)

$ cd %your_project_dir%
$ tinylrs './your_watch_dir/**/*.*'

Maybe you should add char '' to include the target dir if you use it in osx(mac) or other unix like.

step 3: visit the web site by your own server

eg: http://localhost:8080/index

Now,browser page will be refreshed when your watched-target-files were changed!

More-detail

1.command line

$ tinylrs --help
Usage: tinylrs [options]
   eg: tinylrs './dist/**/*.*'
       tinylrs './dist/**/*.js,./dist/**/*.css,../../views/**/*.html'
       tinylrs -d './dist/**/*.js,./dist/**/*.css'  -p 35279
       tinylrs --dirs='./dist/**/*.js,./dist/**/*.css'  --port=35279

Options:

 -h,--help           show usage information
 -V,--version        show current version information
 -d,--dirs<folder>   *necessary!!* The director of watch targets files,
                     both path-array and single-path
 -p,--port<integer>  unnecessary! The server port,both websocket-server
                     and static-file-server,default 35279
 -l,--lrfile<file>   unnecessary! The filepath of 'livereload.js',
                     default a build-in-file

(1).param support the array,just like this: (array ele split by char ',')

$ tinylrs './watch_dir_0/**/*.js,./watch_dir_1/**/*.css,./watch_dir_2/**/*.html'

(2).You can also set the server port by runtime args:*

$ tinylrs -d './your_watch_dir/**/*.*'  -p 66666

besides,you should set the same port to the <script> tag

<script src="http://localhost:66666/livereload.js?snipver=1"></script>

(3).run in your npm-scripts

1: package.json

{
  "scripts":{
    "tinylrs": "tinylrs -d './your_watch_dir/**/*.*' -p 66666"
  }
}

2: run in bash

$ npm run tinylrs

2.development

var Tinylrs = require("tinylrs");
var myTlrs = Tinylrs({
    watchList: [
        "./dist/**/*.*",
        "../public/views/*.html"
    ],
    port: 66666,
    lrfile: null
});
myTlrs.start();
// you can also use the myTlrs.server,it is a tiny-lr server instance

Questions

1.Install failed: You maybe include 'sudo' in front of command line,if use it on *unix os like linux or mac-osx

sudo npm i -g tinylrs

2.No matches found: xxxx/path/xxxx

check the directors you have type in,if use it on *unix os like linux or mac-osx

Have fun with it!

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

10 years ago

0.0.58

10 years ago

0.0.57

10 years ago

0.0.56

10 years ago

0.0.55

10 years ago

0.0.54

10 years ago

0.0.53

10 years ago

0.0.52

10 years ago

0.0.51

10 years ago

0.0.50

10 years ago

0.0.49

10 years ago

0.0.48

10 years ago

0.0.47

10 years ago

0.0.46

10 years ago

0.0.45

10 years ago

0.0.43

10 years ago

0.0.42

10 years ago

0.0.41

10 years ago

0.0.40

10 years ago

0.0.39

10 years ago

0.0.38

10 years ago

0.0.37

10 years ago

0.0.36

10 years ago

0.0.35

10 years ago

0.0.34

10 years ago

0.0.33

10 years ago

0.0.32

10 years ago

0.0.31

10 years ago

0.0.30

10 years ago

0.0.29

10 years ago

0.0.28

10 years ago

0.0.27

10 years ago

0.0.26

10 years ago

0.0.25

10 years ago

0.0.24

10 years ago

0.0.23

10 years ago

0.0.22

10 years ago

0.0.21

10 years ago

0.0.20

10 years ago

0.0.19

10 years ago

0.0.18

10 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago