https://github.com/fox-archives/is_exe
Test if a file is executable
https://github.com/fox-archives/is_exe
Last synced: 4 months ago
JSON representation
Test if a file is executable
- Host: GitHub
- URL: https://github.com/fox-archives/is_exe
- Owner: fox-archives
- License: mit
- Archived: true
- Created: 2020-05-09T14:38:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-24T10:49:30.000Z (about 2 years ago)
- Last Synced: 2025-01-17T16:37:25.259Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is_exe


A port of the [https://github.com/isaacs/isexe](https://github.com/isaacs/isexe) package for Deno.
NOTE: currently not working for windows
## Usage
```sh
deno run --allow-read --allow-env main.ts
``````js
// 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')
}
```### Versions
You can pin per version:
```sh
https://deno.land/x/is_exe/v1.1.0/mod.ts
```## API
### `isExecutable(filePath, [options])`
### Options
- `ignoreErrors` treat all errors as "no, this is not executable", but don't raise them.
- `uid` number to use as the user id
- `gid` number to use as the group id
- `pathExt` list of path extensions to use instead of PATHEXT environment variable on Windows *(not implemented)*