Skip to content

Instantly share code, notes, and snippets.

@panthomakos
panthomakos / example1.js
Created June 30, 2011 07:23
Avoiding Nested Callbacks in Javascript
var fs = require('fs');
fs.mkdir('./hello',0777,makeDirectory);
function makeDirectory(err){
if (err) throw err;
fs.writeFile('./hello/world.txt', 'Hello!', writeFile);
}
function writeFile(err){