Sha256: b422b8fbb7815542dfbd1b3adaec5700249a1934c44a1d994654329c06fc1018

Contents?: true

Size: 890 Bytes

Versions: 186

Compression:

Stored size: 890 Bytes

Contents

module.exports = isexe
isexe.sync = sync

var fs = require('fs')

function checkPathExt (path, options) {
  var pathext = options.pathExt !== undefined ?
    options.pathExt : process.env.PATHEXT

  if (!pathext) {
    return true
  }

  pathext = pathext.split(';')
  if (pathext.indexOf('') !== -1) {
    return true
  }
  for (var i = 0; i < pathext.length; i++) {
    var p = pathext[i].toLowerCase()
    if (p && path.substr(-p.length).toLowerCase() === p) {
      return true
    }
  }
  return false
}

function checkStat (stat, path, options) {
  if (!stat.isSymbolicLink() && !stat.isFile()) {
    return false
  }
  return checkPathExt(path, options)
}

function isexe (path, options, cb) {
  fs.stat(path, function (er, stat) {
    cb(er, er ? false : checkStat(stat, path, options))
  })
}

function sync (path, options) {
  return checkStat(fs.statSync(path), path, options)
}

Version data entries

186 entries across 185 versions & 22 rubygems

Version Path
immosquare-cleaner-0.1.22 node_modules/isexe/windows.js
immosquare-cleaner-0.1.21 node_modules/isexe/windows.js
immosquare-cleaner-0.1.20 node_modules/isexe/windows.js
immosquare-cleaner-0.1.19 node_modules/isexe/windows.js
immosquare-cleaner-0.1.18 node_modules/isexe/windows.js
immosquare-cleaner-0.1.17 node_modules/isexe/windows.js
immosquare-cleaner-0.1.16 node_modules/isexe/windows.js
immosquare-cleaner-0.1.14 node_modules/isexe/windows.js
immosquare-cleaner-0.1.13 node_modules/isexe/windows.js
immosquare-cleaner-0.1.12 node_modules/isexe/windows.js
immosquare-cleaner-0.1.11 node_modules/isexe/windows.js
immosquare-cleaner-0.1.10 node_modules/isexe/windows.js
immosquare-cleaner-0.1.9 node_modules/isexe/windows.js
immosquare-cleaner-0.1.8 node_modules/isexe/windows.js
immosquare-cleaner-0.1.7 node_modules/isexe/windows.js
immosquare-cleaner-0.1.6 node_modules/isexe/windows.js
decidim-0.26.8 packages/eslint-config/node_modules/isexe/windows.js
disco_app-0.18.0 test/dummy/node_modules/isexe/windows.js
disco_app-0.18.2 test/dummy/node_modules/isexe/windows.js
epuber-stylus-source-0.56.0 vendor/node_modules/isexe/windows.js