node-watchd

0.0.1 • Public • Published

Node Watchd

This is a nodejs module which contains a watchd server and a client.

What's this used for

Sometimes you need to watch some files change (normally, as a developer). For example, you have three javascripts, you would like to use uglifyjs to compile them into one. Certainly you could do it by hand:

uglifyjs *.js > my.js

Then you include my.js in your html file.

<script src="my.js"></script>

It is fine. But everytime you change the original file, you need to redo this work. That is really boring.

There is also similar utilities, for example, you could use compass to watch .scss files.
But what about a common server for doing this???

So that's the idea!!!

How to install

Cause it is a nodejs module, so you need to install nodejs first. And then install it by npm just like a normal nodejs module.

npm install node-watchd

How to use

  • start the server

      $ watchd
    
  • use command line tool to add to the watch list, use -h to view help

      $ watch -h
    

Examples

yarco@me node-watchd$ ./bin/watch -l
Key	File						Action
yarco@me node-watchd$ ./bin/watch tmp.js tmp.txt -a 'cat tmp.js tmp.txt > all.txt'
Key	File						Action
0	/Users/yarco/Sites/js/node-watchd/tmp.js	cat tmp.js tmp.txt > all.txt
1	/Users/yarco/Sites/js/node-watchd/tmp.txt	cat tmp.js tmp.txt > all.txt
yarco@me node-watchd$ ./bin/watch -r 1
Key	File						Action
0	/Users/yarco/Sites/js/node-watchd/tmp.js	cat tmp.js tmp.txt > all.txt

Sugguestion

You could contact yarco.wang@gmail.com for this extension. Or for programming related things, whatever.

This guy currently works in Wiredcraft.com. So you could also get him by yarco@wiredcraft.com

All rights reserved by human.

Readme

Keywords

none

Package Sidebar

Install

npm i node-watchd

Weekly Downloads

0

Version

0.0.1

License

BSD

Last publish

Collaborators

  • yarco