Skip to content

Instantly share code, notes, and snippets.

@baudehlo
Created April 21, 2011 16:11
Show Gist options
  • Save baudehlo/934883 to your computer and use it in GitHub Desktop.
Save baudehlo/934883 to your computer and use it in GitHub Desktop.
function get_filename (id, cb) {
id = id || 1;
path.exists(path.join(root, id, '.ext'), function (exists) {
if (exists) {
get_filename(id++, cb);
}
else {
cb(id);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment