jonmagic/nvatom — pull request #4 by jonmagic (2014-12-01 23:00:51+00:00)
Title: Add PathWatcher

```
// Public: PathWatcher takes a path and an object with update and remove
// functions and first calls update for every file in the path and then watches
// the path for file changes and calls update or remove as needed.
//
// path - String path to directory to load and watch
// extensions - Array of extensions (each is a String)
// callbacks - Object with update and remove functions
//
// Example Usage:
//
// > var PathWatcher = require("./browser/PathWatcher");
// > var path = "/tmp";
//
// > var callbacks = {
// update: function(details) {
// console.log("Updated", details.filename);
// },
// remove: function(filename) {
// console.log("Removed", filename);
// }
// }
//
// > new PathWatcher(path, [".md"], callbacks);
// { path: "/tmp", extensions: [".md"] }
//
// > var fs = require("fs")
// > fs.writeFileSync(path + "/foo.md", "hello world");
// Updated foo.md
// > fs.unlinkSync(path + "/foo.md")
// Removed foo.md
//
// Returns an Object.
```