is-executable
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

is-executable

Check whether a file can be executed

Install

npm install is-executable

Usage

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<boolean>

isExecutableSync(filePath: string) => boolean

Package Sidebar

Install

npm i is-executable

Weekly Downloads

7

Version

2.0.1

License

MIT

Unpacked Size

3.84 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus