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.62 node_modules/isexe/windows.js
immosquare-cleaner-0.1.61 node_modules/isexe/windows.js
immosquare-cleaner-0.1.60 node_modules/isexe/windows.js
immosquare-cleaner-0.1.59 node_modules/isexe/windows.js
immosquare-cleaner-0.1.58 node_modules/isexe/windows.js
immosquare-cleaner-0.1.57 node_modules/isexe/windows.js
immosquare-cleaner-0.1.56 node_modules/isexe/windows.js
immosquare-cleaner-0.1.55 node_modules/isexe/windows.js
immosquare-cleaner-0.1.54 node_modules/isexe/windows.js
immosquare-cleaner-0.1.53 node_modules/isexe/windows.js
immosquare-cleaner-0.1.52 node_modules/isexe/windows.js
trusty-cms-6.3.1 node_modules/isexe/windows.js
immosquare-cleaner-0.1.51 node_modules/isexe/windows.js
immosquare-cleaner-0.1.50 node_modules/isexe/windows.js
immosquare-cleaner-0.1.49 node_modules/isexe/windows.js
immosquare-cleaner-0.1.48 node_modules/isexe/windows.js
immosquare-cleaner-0.1.47 node_modules/isexe/windows.js
immosquare-cleaner-0.1.46 node_modules/isexe/windows.js
pcp-server-ruby-sdk-0.0.6 node_modules/isexe/windows.js
pcp-server-ruby-sdk-0.1.0 node_modules/isexe/windows.js