.bin/docs.js
function (done) {

            console.log('generating markdown docs...');

            var tasks = {},
                taskNames = ['index', 'friendship', 'plugin', 'relationships'];

            // go through each task name
            taskNames.forEach(function (name) {
                // add this task function to the object
                tasks[name] = function (done) {

                    var sourceFilename = 'lib/' + name + '.js';
                    var targetFilename = 'doc/'+ name +'.md';

                    console.log(sourceFilename + ' -> ' + targetFilename);

                    var reader = fs.createReadStream(sourceFilename);

                    // create a write stream to the new markdown file whose name is the task name
                    var writer = fs.createWriteStream(targetFilename, { flags: 'w+'})
                        .on('finish', done);

                    // now pipe each file to jsdoc2md then pipe its output to 
                    // the write stream
                    reader.pipe(jsdoc2md()).pipe(writer);
                };
            }); 

            // now run our named tasks in parallel with async
            async.parallel(tasks, function (err, results) {
                if (err) done(err);
                else {
                    console.log('finished generating markdown docs.');
                    done();  
                } 
            });
        }
function (done) {

            console.log('generating markdown docs...');

            var tasks = {},
                taskNames = ['index', 'friendship', 'plugin', 'relationships'];

            // go through each task name
            taskNames.forEach(function (name) {
                // add this task function to the object
                tasks[name] = function (done) {

                    var sourceFilename = 'lib/' + name + '.js';
                    var targetFilename = 'doc/'+ name +'.md';

                    console.log(sourceFilename + ' -> ' + targetFilename);

                    var reader = fs.createReadStream(sourceFilename);

                    // create a write stream to the new markdown file whose name is the task name
                    var writer = fs.createWriteStream(targetFilename, { flags: 'w+'})
                        .on('finish', done);

                    // now pipe each file to jsdoc2md then pipe its output to 
                    // the write stream
                    reader.pipe(jsdoc2md()).pipe(writer);
                };
            }); 

            // now run our named tasks in parallel with async
            async.parallel(tasks, function (err, results) {
                if (err) done(err);
                else {
                    console.log('finished generating markdown docs.');
                    done();  
                } 
            });
        }
jsdoc2md