Sha256: ad1ff87733d537113add454a02a0f679f3132d6acad15d739393bd62dadee7c2

Contents?: true

Size: 851 Bytes

Versions: 62

Compression:

Stored size: 851 Bytes

Contents

var fs = require('graceful-fs');

var readdir = fs.readdir.bind(fs);
var readdirSync = fs.readdirSync.bind(fs);

module.exports = fs;

module.exports.readdir = function (dir, callback) {
    fs.stat(dir, function (err, stats) {
        if (err) return callback(err);

        if (stats.isDirectory()) {
            return readdir(dir, callback);
        } else {
            var error = new Error('ENOTDIR, not a directory \'' + dir + '\'');
            error.code = 'ENOTDIR';
            error.path = dir;
            error.errono = -20;
            return callback(error);
        }
    });
};

module.exports.readdirSync = function (dir) {
    var stats = fs.statSync(dir);

    if (stats.isDirectory()) {
        return readdirSync(dir);
    } else {
        var error = new Error();
        error.code = 'ENOTDIR';
        throw error;
    }
};

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.6.2 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.6.1 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.6 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.19 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.18 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.17 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.16 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.15 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.14 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.13 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.12 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.11 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.10 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.9 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.8 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.7 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.6 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.5 node_modules/bower/lib/util/fs.js
trusty-festivity-extension-2.5.4 node_modules/bower/lib/util/fs.js