How to use the symlinkSync function from graceful-fs

Find comprehensive JavaScript graceful-fs.symlinkSync code examples handpicked from public code repositorys.

487
488
489
490
491
492
493
494
495
496
497
498
exports.open = Promise.promisify(fs.open);
exports.openSync = fs.openSync;


// symlink
exports.symlink = Promise.promisify(fs.symlink);
exports.symlinkSync = fs.symlinkSync;


// read
exports.read = Promise.promisify(fs.read);
exports.readSync = fs.readSync;
fork icon9
star icon48
watch icon0

+ 7 other calls in file

49
50
51
52
53
54
55
56
57
58
  const relative = symlinkPathsSync(srcpath, dstpath)
  srcpath = relative.toDst
  type = symlinkTypeSync(relative.toCwd, type)
  const dir = path.dirname(dstpath)
  const exists = fs.existsSync(dir)
  if (exists) return fs.symlinkSync(srcpath, dstpath, type)
  mkdirsSync(dir)
  return fs.symlinkSync(srcpath, dstpath, type)
}

fork icon0
star icon1
watch icon1

+ 7 other calls in file

160
161
162
163
164
165
166
167
168
169
170
171
  }
}


function copyLink (resolvedSrc, dest) {
  fs.unlinkSync(dest)
  return fs.symlinkSync(resolvedSrc, dest)
}


// return true if dest is a subdir of src, otherwise false.
// extract dest base dir and check if that is the same as src basename.
fork icon0
star icon0
watch icon0

+ 5 other calls in file