watcher — Utility for watching file trees in node.js
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test/dir/subdir
.gitignore
LICENSE
Makefile
cli.js
main.js
package.json
readme.md

readme.md

watcher — Utility for watching file trees in node.js

Install

  npm install -g git://github.com/Wikimapia/watcher.git

Purpose

Module is aimed to make easier the simple automation of watching of directory trees.

Usage

  $ watcher -i 250 -d . -a 'echo $file was $action';

Args:

  --directory, -d  Define the root directory to watch, if this is not defined
                   the program will use the current working directory.
  --created, -c    Command to handle created files                              
  --modified, -m   Command to handle modified files                             
  --removed, -r    Command to handle deleted files                              
  --all, -a        Command to handle all file changes                           
  --interval, -i   Watcher interval                               [default: 150]
  --help, -h       Show this message

Command handlers

Handlers are your custom shell commands called for each modified file. Passed as strings, following placeholders will be replaced with actual values

$file     -> full name
$action   -> [created|modified|removed]
$relative -> relative path(to process)
$fileName -> base name of the file