Upstreaming update
Monday, May 16, 2016 by Dave Winer

On May 8, I wrote a blog post about upstreaming in Node.js.

I heard on the Facebook thread that there is a package that does an excellent job of handling notification of file updates. This is an area that the built-in routines in Node fall short.

I decided to create my own utility, it's a Node app that watches a folder, and uploads any new or changed files to a location on Amazon S3. You can configure how often it runs.

It does it with a recursive scan of the folder structure. It looks at every file's mod date and compares it with the last date. Very simple approach.

Of course even a very simple approach can be mind-numbingly complex in JavaScript. It's all async. To get it to really work I had to introduce a file queue, and even at that there are still times when it stops scanning.

In other words, I will have to take another look at this, but right now I'm moving on. It's worth a blog post because I've posted the code, with setup instructions on GitHub. I'll be watching the Issues section of the repo so if you discover problems please report there. Thanks.