kevva/download — pull request #4 by ryanlelek (2013-11-16 00:24:25+00:00)
Title: Rename Files Individually and Prevent Race Condition

I needed the ability to rename files on an individual basis.
While adding renaming functionality, I kept running into what I think is a race condition when emitting "close" when tests were run.

Here's a way to pull request to prevent that race condition and give each file a unique name.
```Javascript
// Crazy, dynamic image URLs (GitHub's and Joyent's Gravatars)
// We can specify a filename property to give them a sensible name
var src = [
{ filename: 'github_gravatar.png', url: 'https://2.gravatar.com/avatar/61024896f291303615bcd4f7a0dcfb74?d=https%3A%2F%2Fidenticons.github.com%2Fae816a80e4c1c56caa2eb4e1819cbb2f.png&r=x&s=440' },
{ filename: 'joyent_gravatar.png', url: 'https://0.gravatar.com/avatar/95c8b4070c2ba024f87a8fdca63e9d24?d=https%3A%2F%2Fidenticons.github.com%2Fb569502f473b890f9fcfc45b8a227baa.png&r=x&s=440' }
];

var dest = 'tmp';
var dl = download(src, dest);
```

Tests added and all pass