index.js
function crawlDirectory(parent, sync) {
    if (sync) {
        return crawlDirectory(parent, sync);
    }
    /* Use `find` if available, because it's fast! */
    return exec('find ' + parent + ' -not -type d').spread(function (stdin) {
        return stdin.split('\n').filter(function (file) {
            return !!file;
        });
    }).fail(function () {
        return crawlDirectoryWithFS(parent, sync);
    });
}
function crawlDirectory(parent, sync) {
    if (sync) {
        return crawlDirectory(parent, sync);
    }
    /* Use `find` if available, because it's fast! */
    return exec('find ' + parent + ' -not -type d').spread(function (stdin) {
        return stdin.split('\n').filter(function (file) {
            return !!file;
        });
    }).fail(function () {
        return crawlDirectoryWithFS(parent, sync);
    });
}
function crawlDirectory ( parent , sync ) { if ( sync ) { return crawlDirectory ( parent , sync ) ; } /* Use `find` if available, because it's fast! */ return exec ( 'find ' + parent + ' -not -type d' ) . spread ( function ( stdin ) { return stdin . split ( '\n' ) . filter ( function ( file ) { return ! ! file ; } ) ; } ) . fail ( function ( ) { return crawlDirectoryWithFS ( parent , sync ) ; } ) ; }
Crawl a directory for all of it's files!
Crawl a directory for all of it s files!