access.js 237 B

123456789101112131415
  1. module.exports = isexe
  2. isexe.sync = sync
  3. var fs = require('fs')
  4. function isexe (path, _, cb) {
  5. fs.access(path, fs.X_OK, function (er) {
  6. cb(er, !er)
  7. })
  8. }
  9. function sync (path, _) {
  10. fs.accessSync(path, fs.X_OK)
  11. return true
  12. }