selaux/node-sprite-generator — pull request #7 by johnyanarella (2013-11-01 21:41:05+00:00)
Title: A "Fatal error: spawn EMFILE" error is thrown when a large number of files are specified.

When a large number of files are specified, async.map() ends up spawning too many processes, triggering a `Fatal error: spawn EMFILE` error.

I have ulimit configured to `unlimited` on my Mac Pro (running 10.9), but in practice this turns out to be 80.

Fortunately, async.js offers the ability to limit how many operations are executed in parallel, by using `async.mapLimit()` instead of `async.map()`.

I guess the options here are to 1) make this an arbitrary value (as in this pull request) or 2) make it configurable via an option (with something between 20-80 as the default).

Thanks again for sharing this library. For our current project, we've combined it with `grunt-contrib-watch` -- compared to waiting on a designer to manually update a spritesheet/CSS (as we were before), it's been magical to be able to drop an image in a sprite directory and watch the spritesheet and CSS get regenerated automatically. Sometime in the next couple days I'm planning to polish up the custom packing layout algorithm we're using, to contribute back to your project.