With focus on how errors are handled:
There\'s the style that fs
promotes: One callback where the first argument is an error (if any), and the
I will certainly say that in most cases, you will see the following signature for callbacks.
function (err, result)
This is pretty much standard today.
But it also depends on what you need to "return" like in the createServer example where two objects are passed back to the callback.
createServer(function (req, res) {
});
This is mostly the exception and in most libraries you will see the first form.