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()) {
fork icon0
star icon1
watch icon0

+ 53 other calls in file

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, '');
fork icon0
star icon0
watch icon0

+ 5 other calls in file

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);
fork icon0
star icon0
watch icon0

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
fork icon0
star icon0
watch icon0

+ 9 other calls in file

function icon

fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)