How to use the fs-promise.stat function in fs-promise

To help you get started, we’ve selected a few fs-promise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / loop / bin / run-utils.js View on Github external
return When.promise(function(resolve, reject) {
    profile = Path.normalize(profile);
    if (!Path.isAbsolute(profile)) {
      profile = Path.join(process.cwd(), profile);
    }
    Fs.stat(profile).then(function(stat) {
      if (!stat.isDirectory()) {
        reject("Profile path '" + profile + "' is not a directory");
        return;
      }
      resolve(profile);
    }).catch(reject);
  });
}
github pencilblue / pencilblue / lib / utils / fileUtils.js View on Github external
var promises = files.map(function (file) {
                var fullPath = path.join(dirPath, file);
                return FsPromise.stat(fullPath).then(function (stat) {
                    if (stat.isDirectory()) {
                        dirs.push(fullPath);
                    }
                });
            });
            return Q.all(promises).thenResolve(dirs);
github rakutentech / docpub / lib / fs-utils.js View on Github external
.filter(entry => {
            if (entry.startsWith('.')) {
                return false;
            }

            const subdirPath = path.join(srcPath, entry);

            return fs.stat(subdirPath)
                .then(stat => {
                    return stat.isDirectory();
                })
                .catch(() => {
                    return false;
                });
        })
        .map(entry => path.join(srcPath, entry));
github tomdale / lambda-packager / lib / packager.js View on Github external
function verifyInputs() {
    return fsp.stat(packagePath)
      .then(function(stats) {
        if (!stats.isDirectory()) {
          throw new Error(packagePath + " is not a directory");
        }
      });
  }
github tableflip / guvnor / lib / process-wrapper / master / rpc / list-heap-snapshots.js View on Github external
  .then(files => Promise.all(files.map(file => fs.stat(file).then(stat => {
    stat.path = file
    return stat
  }))))
  .then(stats => stats.map(stat => {

fs-promise

[DEPRECATED] Use mz or fs-extra^3.0 with Promise Support

MIT
Latest version published 7 years ago

Package Health Score

50 / 100
Full package analysis