https://github.com/sindresorhus/is-executable
Check whether a file can be executed
https://github.com/sindresorhus/is-executable
nodejs
Last synced: 9 months ago
JSON representation
Check whether a file can be executed
- Host: GitHub
- URL: https://github.com/sindresorhus/is-executable
- Owner: sindresorhus
- License: mit
- Created: 2015-12-17T03:24:57.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-04-08T12:18:11.000Z (over 3 years ago)
- Last Synced: 2024-04-14T11:09:13.767Z (over 2 years ago)
- Topics: nodejs
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 43
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# is-executable
> Check whether a file can be [executed](https://www.yesik.it/blog/2018-the-x-permission-bit)
## Install
```sh
npm install is-executable
```
## Usage
```js
import {isExecutable} from 'is-executable';
// On macOS
await isExecutable('/usr/bin/bash');
//=> true
// On macOS
await isExecutable('/Users/sindresorhus/unicorn.png');
//=> false
// On Windows
await isExecutable('c:\\Windows\\notepad.exe');
//=> true
```
## API
### `isExecutable(filePath: string) => Promise`
### `isExecutableSync(filePath: string) => boolean`