knaurotski: session-1-homework

my server is using q and mime modules
You are using Q but with your style you are not getting any advantages from promises
I would rewrite this code as following:

    var deferred = q.defer();
    fs.exists('.' + path, q.resolve);

    return deferred.promise
        .then(function(exists) {
            if (!exists) {
                return { type: 'message', data: 'Path not exists' };
            }
            return q.nfcall(fs.stat, '.' + path);
        })
        .then(function (stats) {
            var dataWithType = function(type) {
                return function(data) {
                    return { type: 'file', data: data };
                };
            };
            if (stats.isFile()) {
                return q.nfcall(fs.readFile, '.' + path).then(dataWithType('file');
            }
            if (stats.isDirectory) {
                return q.nfcall(fs.readdir, '.' + path).then(dataWithType('directory');
            }
        });