node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

largest-file

Largest File

Find the largest file in a specify directory

Usage

CO style

largest = thunkify(largest);
co(function *() {
    try {
        var largestFile = yield largest(dir);
        console.log('The largest file in %s is %s', dir, largestFile);
    } catch (e) {
        console.log('Oh, got error!');
    }
})();

Callback style

largest(dir, function (err, largestFile) {
    console.log('The largest file in %s is %s', dir, largestFile);
});