How to use the lstat function from fs-extra
Find comprehensive JavaScript fs-extra.lstat code examples handpicked from public code repositorys.
7135 7136 7137 7138 7139 7140 7141 7142 7143 7144
const basePath = process.cwd() const currentPath = path.resolve(basePath, src) const targetPath = path.resolve(basePath, dest) if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) fs.lstat(src, (err, stats) => { if (err) return callback(err) let dir = null if (stats.isDirectory()) {
0
1
0
+ 53 other calls in file
GitHub: saby/builder
24 25 26 27 28 29 30 31 32 33 34 35
await timeout(1000); } }; const getMTime = async function(filePath) { return (await fs.lstat(filePath)).mtime.getTime(); }; const removeRSymbol = function(str) { return str.replace(/\r/g, '');
0
0
0
+ 5 other calls in file
GitHub: saby/builder
22 23 24 25 26 27 28 29 30 31 32
function generateTaskForSymlinkCompiled(taskParameters, moduleInfo, moduleOutput) { return async function symlinkCompiledModule() { const compiledPath = getCompiledPath(taskParameters, moduleInfo); try { const stats = await fs.lstat(moduleOutput); if (stats.isSymbolicLink()) { await fs.unlink(moduleOutput); } else { await fs.remove(moduleOutput);
0
0
0
GitHub: snapptop/ninjs-lodash
33 34 35 36 37 38 39 40 41 42
let path = _.get(options, 'path') || '' let root = _.get(options, 'root') || '' if(!path) return _.fail('Invalid path', callback) return fs.lstat(path, (err, stat) => { if (err) return _.fail(err, callback) let rel = root ? path.replace(root, '') : path rel = _.startsWith(rel, _.path.sep) ? rel.substr(1) : rel
0
0
0
+ 9 other calls in file
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)