June, 2011

20
Jun 11

Version 0.0.9 of Stalker for node.js is available

I have just released 0.0.9 of Stalker. Improvements (some from 0.0.7 as well) are:

  • Added batch mode to group callbacks
  • Added second callback for file removal notices (this works in batch mode as well)
  • Switched unit tests to vows.js and added additional coverage
  • Made errors callback immediately in standard node-fashion.
  • Fixed bugs

Get it on npm now or head to github.

Thank you for all the feedback.

08
Jun 11

Introducing stalker, a node.js module. Now your files can get restraining orders against you too.

I released my first node.js module today on npm, aptly named stalker. stalker is basically a wrapper around fs.watchFile(). It will watch a directory tree for new files and fire off your callback whenever it finds one. It tries to be smart about entire nested folder/file structures and tricksy add/removal/add type of stuff.

Get it on npm: npm install stalker

You can test it by running node example/test.js and then dropping files and folders in the example directory.

To incorporate it in your program, simply call stalker.watch with your callback:

stalker.watch('/var/foo', function(err, file) {
  console.log('stalker saw file %s', file);
});

Code is at github: https://github.com/jslatts/stalker