If we interpret the "idiomatic Node" as "what Node himself does," then null will be what is idiomatic. If you type this at the Node prompt (on * nix machine), you will get true :
require("fs").readFile("/dev/null", function (err) { console.log(err === null) })
I tried with other callbacks from the fs module and got the same behavior. I have not tested all the places in the Node API where callbacks are used.
I did not find a link that says Node should set err to null in such cases.
Louis
source share