npm.io
2.0.2 • Published 7 months ago

is-executable

Licence
MIT
Version
2.0.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
45

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

Keywords