From the docs:
fs.write(fd, buffer, offset, length[, position], callback)
fs.write(fd, data[, position[, encoding]], callback)
By default the method signature is this:
function (fd, buffer, offset, length, position, callback)
The parameters can change depending on the input:
if (buffer instanceof Buffer) {
// if no position is passed then assume null
if (typeof position === 'function') {
callback = position;
position = null;
}
The tls.connect() method also has two different signatures.