aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@soyuka/exists-sync/index.js
blob: b33d88bcc51cedba7e3c50a3d97407efb5cc5c67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict'
const fs = require('fs')

/**
 * fs.existsSync is deprecated
 */
module.exports = function existsSync(path) {
  var exists = false

  try {
    fs.accessSync(path, fs.F_OK)
    exists = true
  } catch(e) {}

  return exists
}