Skip to content

Instantly share code, notes, and snippets.

@scottcorgan
Created December 22, 2012 00:35
Show Gist options
  • Save scottcorgan/4356796 to your computer and use it in GitHub Desktop.
Save scottcorgan/4356796 to your computer and use it in GitHub Desktop.
Async anything
function (foo, callback) {
process.nextTick(function() {
var error = null, data;
try {
data = JSON.parse(foo);
}
catch (ex) {
error = ex;
}
callback(error, data);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment