# executable

> Check if a file is executable

Latest version **4.1.1** (published 2018-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install executable
pnpm add executable
yarn add executable
bun add executable
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2018-02-07 |
| First published | 2014-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | exec, executable, permission |

## Links

- npm: https://www.npmjs.com/package/executable
- Repository: https://github.com/kevva/executable
- Homepage: https://github.com/kevva/executable#readme
- Issues: https://github.com/kevva/executable/issues
- npm.io page: https://npm.io/package/executable

## Dependencies (1)

- [pify](https://npm.io/package/pify.md) ^2.2.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 4.1.1 (latest) — 2018-02-07
- 4.1.0 — 2016-08-23
- 4.0.0 — 2016-06-03
- 3.0.0 — 2016-01-05
- 2.1.0 — 2015-12-01
- 2.0.0 — 2015-10-05
- 1.1.0 — 2015-04-09
- 1.0.3 — 2014-10-28
- 1.0.2 — 2014-09-16
- 1.0.1 — 2014-09-08
- 1.0.0 — 2014-08-17
- 0.1.3 — 2014-08-12
- 0.1.2 — 2014-04-30
- 0.1.1 — 2014-03-26
- 0.1.0 — 2014-02-06

## README

# executable [![Build Status](https://travis-ci.org/kevva/executable.svg?branch=master)](https://travis-ci.org/kevva/executable)

> Check if a file is executable


## Install

```
$ npm install --save executable
```


## Usage

```js
const executable = require('executable');

executable('bash').then(exec => {
	console.log(exec);
	//=> true
});
```


## API

### executable(file)

Returns a Promise for a boolean.

### executable.sync(file)

Returns a boolean of whether the file is executable.

#### file

Type: `string`

Path of the file.

### executable.checkMode(mode, [gid], [uid])

Returns a boolean of whether the mode passed as first argument means that the file is executable.

#### mode

Type: `number`

Property `mode` of `fs.Stats` instance returned by `fs.stat()` (or `fs.statSync()`) function.

#### gid, uid

Type: `number`

Respectively the group identity and user identity of the file. If not set, permissions will be evaluated without considering owner or group of the file.

## Related

* [executable-cli](https://github.com/kevva/executable-cli) - CLI for this module


## License

MIT © [Kevin Mårtensson](https://github.com/kevva)

---
_Source: https://npm.io/package/executable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
