mathquill/mathquill — pull request #228 by laughinghan (2014-01-24 04:43:33+00:00)
Title: Fix #227 .less files not being auto-recompiled

Quick googling turns up hundreds of wrappers around `fs.watch()` that watch recursively, as well as doing lots of unnecessary stuff like allowing globbing paths, all of which are also hundreds of lines long.

The `fs.readdir()` trick is from isaacs' filewatcherthing: https://github.com/isaacs/filewatcherthing/commit/740c76db4bcfd96bb087eca7f47d02828df2788d

I'm not sure why isaacs guarded against `.` and `..`, `fs.readdir()` supposedly (and empirically) excludes them: http://nodejs.org/api/fs.html#fs_fs_readdir_path_callback