How to use the lstat function from fs-promise

Find comprehensive JavaScript fs-promise.lstat code examples handpicked from public code repositorys.

80
81
82
83
84
85
86
87
88
89
90
91


// String ~> Promise Bool
const isDirectory = path =>
  fsp.exists(path)
    .then(assert)
    .then(() => fsp.lstat(path))
    .then(stats => stats.isDirectory())
    .catch(() => false);


// String -> Promise String
fork icon7
star icon12
watch icon0

105
106
107
108
109
110
111
112
113
114
115
};


// String ~> Promise Bool
var isDirectory = function isDirectory(path) {
  return fsp.exists(path).then(assert).then(function () {
    return fsp.lstat(path);
  }).then(function (stats) {
    return stats.isDirectory();
  }).catch(function () {
    return false;
fork icon7
star icon12
watch icon0