A port of the https://github.com/isaacs/isexe package for Deno.
NOTE: currently not working for windows
deno run --allow-read --allow-env main.ts
// main.ts
import { isExecutable } from 'https://deno.land/x/is_exe/mod.ts'
try {
const isExe = await isExecutable('./file')
isExe && console.log('file is executable')
} catch {
console.log('error reading file')
}
You can pin per version:
https://deno.land/x/is_exe/v1.1.0/mod.ts
ignoreErrors
treat all errors as "no, this is not executable", but don't raise them.uid
number to use as the user idgid
number to use as the group idpathExt
list of path extensions to use instead of PATHEXT environment variable on Windows (not implemented)