jonmagic/nvatom — pull request #2 by jonmagic (2014-11-29 10:50:05+00:00)
Title: Add document loader

```
// Public: DocumentLoader 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 DocumentLoader = require("./browser/DocumentLoader");
// > var path = "/tmp";
//
// > var callbacks = {
// update: function(details) {
// console.log("Updated", details.filename);
// },
// remove: function(filename) {
// console.log("Removed", filename);
// }
// }
//
// > new DocumentLoader(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.
```