Hacker News new | ask | show | jobs
by ewolfe 4565 days ago
You might be interested in nodemon https://github.com/remy/nodemon
2 comments

I've seen nodemon before and this is what worried me the most:

"nodemon has three potential methods it uses to look for file changes. First, it polls using the find command to search for files modified within the last second. This method works on systems with a BSD based find (Mac, for example)."

Especially on Mac OSX why would you prefer to use an external command like find instead of using Kqueue? I wonder if find is the right tool for that. And I wonder again why only on BSD-based systems when linux also has find.

Gotta read a bit more about that.

fyi, this is how nodemon is doing file checking:

find -L /dev/null -type f -mtime -1s -print

(https://github.com/remy/nodemon/blob/master/nodemon.js#L57)

Or, if you're on OSX using fswatch[1] or on linux inotifywatch[2] along with a simple shell script which kills and restarts your server. Crude, but gets the job done..

    [1] https://github.com/alandipert/fswatch
    [2] http://linux.die.net/man/1/inotifywatch