How to use the stat function from fs-promise
Find comprehensive JavaScript fs-promise.stat code examples handpicked from public code repositorys.
76 77 78 79 80 81 82 83 84 85
if (fileExtension === undefined) { return; } const name = `${filename.split(`_${uuid}`)[0]}.${filename.split('.')[1]}`; const filePath = `${basedir}/${filename}`; const fileStats = await fs.stat(filePath); const dateChanged = fileStats.ctime; const fileObject = { uuid,
20
26
0
+ 5 other calls in file
GitHub: marijnh/distfs
60 61 62 63 64 65 66 67 68 69
CachedDir.prototype.resolveEntry = function(name) { var value = this.cache[name], self = this if (!value) return Promise.resolve(null) if (value == dummy) { var fullName = this.path + "/" + name return fs.stat(fullName).then(function(stats) { if (stats.isDirectory()) return self.cache[name] = new CachedDir(fullName, stats, self.mount) if (stats.isFile()) return self.cache[name] = new CachedFile(fullName, stats, self.mount)
3
39
0
45 46 47 48 49 50 51 52 53
} /* --- Generates java func data, if this lang needs any --- */ const make_java_func_data = async () => { if (needs_java_func_data) { await fs.stat(config.build_path + '/java_func_data') .catch(expect_error('ENOENT', java_func_data_generator)); } }
0
1
11
182 183 184 185 186 187 188 189 190 191
if( typeof something === 'string' ) { if( path.basename(something) === '.oathframe.json' ) return resolve(path.dirname(something)); return fs.stat(something).then(stat => (stat.isDirectory() ? createDirectory : createFile)(something)); } throw new Error('Resource: not sure how to resolve ' + something); });
0
1
0
60 61 62 63 64 65 66 67 68
* @param {string[]} elements * @returns {Promise<string[]>} */ function filterDirs(elements) { return promiseFilter(elements, element => { return fs.stat(path.join(baseDir, element)) .then(stats => stats.isDirectory()); }); }
0
0
0
+ 3 other calls in file
fs-promise.writeJson is the most popular function in fs-promise (6458 examples)