ctalkington/node-archiver — pull request #9 by davglass (2013-01-22 15:41:15+00:00)
Title: Using setImmediate instead of process.nextTick when available

In Node 0.9.x (soon to be 0.10.x), archiver doesn't work properly when you have a large amount of files. If you have a large number of files to compress into a zip, you will hit this limit:

https://github.com/joyent/node/blob/master/src/node.js#L341

And it will not complete the zip process, it will just hang in the event loop.

In this request, I've created a `util.nextTick` helper that uses `setImmediate` when available (0.9.x) and falls back to `process.nextTick` when not available.

This makes my tools work again in the latest node (0.9.7)