Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
watch files recursively
JavaScript PHP Shell
Branch: master

This branch is 1 commit ahead, 2 commits behind crcn:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
examples
lib
.cupboard
.gitignore
.ignorewatch
.npmignore
README.md
package.json
project.sublime-project
project.sublime-workspace
project.tmproj

README.md

Features

  • recursively watch files
  • watch new dirs/files that have been added to any watched directory
  • ability to ignore files with .ignorewatch including list of files to ignore (similar to .gitignore). Use * to ignore all files in .ignorewatch directory.

Installation

npm install watch_r

Example

var watch_r = require('watch_r');

watch_r('/path/to/file', function(err, watcher) {

    //add / change
    watcher.on('change', function(target) {

        //changed file
        console.log(target.path);
    })

    watcher.on('remove', function(target) {

        //removed file
        console.log(target.path);
    });
})
Something went wrong with that request. Please try again.