How to use the accessSync function from graceful-fs

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

22
23
24
25
26
27
28
29
30
31
32
33


function existsSync(path) {
  if (!path) throw new TypeError('path is required!');


  try {
    fs.accessSync(path);
  } catch (err) {
    if (err.code !== 'ENOENT') throw err;
    return false;
  }
fork icon9
star icon48
watch icon0

+ 15 other calls in file

11
12
13
14
15
16
17
18
19
20
const overwrite = options.overwrite || options.clobber || false

src = path.resolve(src)
dest = path.resolve(dest)

if (src === dest) return fs.accessSync(src)

if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`)

mkdirpSync(path.dirname(dest))
fork icon0
star icon1
watch icon0

15
16
17
18
19
20
21
22
23
24
25
const appendFileAsync = Promise.promisify(fs.appendFile);
const rmdirAsync = Promise.promisify(fs.rmdir);
const readFileAsync = Promise.promisify(fs.readFile);
const createReadStream = fs.createReadStream;
const createWriteStream = fs.createWriteStream;
const accessSync = fs.accessSync;
const accessAsync = Promise.promisify(fs.access);


function exists(path, callback) {
  if (!path) throw new TypeError('path is required!');
fork icon0
star icon1
watch icon0

+ 15 other calls in file