Do you mean between fs.writeFileSync(..) and the deferred.resolve() call?