Sha256: c0ae205cd682a3d3c89e79e1d09a2aa97154f8ea696ee5ec01c0c35ad09ac9a0

Contents?: true

Size: 735 Bytes

Versions: 7

Compression:

Stored size: 735 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 isexe (path, options, cb) {
  fs.stat(path, function (er, st) {
    cb(er, er ? false : checkPathExt(path, options))
  })
}

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

Version data entries

7 entries across 6 versions & 3 rubygems

Version Path
lanes-0.8.0 node_modules/isexe/windows.js
node-compiler-0.9.1 vendor/node/deps/npm/node_modules/which/node_modules/isexe/windows.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/node_modules/which/node_modules/isexe/windows.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/node_modules/which/node_modules/isexe/windows.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/node_modules/which/node_modules/isexe/windows.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/node_modules/which/node_modules/isexe/windows.js
blackboard-3.1.9 lib/site_template/node_modules/isexe/windows.js