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) }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
test | Folder | 0755 |
|
|
.npmignore | File | 23 B | 0644 |
|
LICENSE | File | 765 B | 0644 |
|
README.md | File | 1.36 KB | 0644 |
|
index.js | File | 1.16 KB | 0644 |
|
mode.js | File | 909 B | 0644 |
|
package.json | File | 2.18 KB | 0644 |
|
windows.js | File | 890 B | 0644 |
|