hound
Cross platform directory tree watcher that works, even on Windows.
Last updated 13 years ago by beefsack .
Repository · Original npm · Tarball · package.json
$ gnpm install hound 
SYNC missed versions from official npm registry.

hound - directory tree watcher for node.js

Cross platform directory tree watcher that works, even on Windows

The philosophy of hound is:

  • Be reliable, work on every platform
  • Be fast
  • Be simple

hound is designed to be very reliable, fast, and simple. There are no runtime dependencies outside of the standard node.js libraries. There is a development dependency on Jasmine, which is required to run the tests.

Installation

Install using npm:

npm install hound

Because hound has no runtime dependencies, it is also possible to download the library manually and require it directly.

Usage

hound = require('hound')

// Create a directory tree watcher.
watcher = hound.watch('/tmp')

// Create a file watcher.
watcher = hound.watch('/tmp/file.txt')

// Add callbacks for file and directory events.  The change event only applies
// to files.
watcher.on('create', function(file, stats) {
  console.log(file + ' was created')
})
watcher.on('change', function(file, stats) {
  console.log(file + ' was changed')
})
watcher.on('delete', function(file) {
  console.log(file + ' was deleted')
})

// Unwatch specific files or directories.
watcher.unwatch('/tmp/another_file')

// Unwatch all watched files and directories.
watcher.clear()

Testing

To run the tests, use npm test. The tests work on actual directory trees that are generated in the tmp directory.

Current Tags

  • 1.0.5                                ...           latest (8 years ago)

6 Versions

  • 1.0.5                                ...           8 years ago
  • 1.0.4                                ...           12 years ago
  • 1.0.3                                ...           12 years ago
  • 1.0.2                                ...           13 years ago
  • 1.0.1                                ...           13 years ago
  • 1.0.0                                ...           13 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |