3 if (process.platform === 'win32' || global.TESTING_WINDOWS) {
4 core = require('./windows.js')
5 } else if (typeof fs.access === 'function') {
6 core = require('./access.js')
8 core = require('./mode.js')
11 module.exports = isexe
14 function isexe (path, options, cb) {
15 if (typeof options === 'function') {
21 if (typeof Promise !== 'function') {
22 throw new TypeError('callback not provided')
25 return new Promise(function (resolve, reject) {
26 isexe(path, options || {}, function (er, is) {
36 core(path, options || {}, function (er, is) {
37 // ignore EACCES because that just means we aren't allowed to run it
39 if (er.code === 'EACCES' || options && options.ignoreErrors) {
48 function sync (path, options) {
49 // my kingdom for a filtered catch
51 return core.sync(path, options || {})
53 if (options && options.ignoreErrors || er.code === 'EACCES') {