1. executable
Check if a file is executable
executable
Package: executable
Created by: kevva
Last modified: Fri, 17 Jun 2022 21:52:59 GMT
Version: 4.1.1
License: MIT
Downloads: 23,661,037
Repository: https://github.com/kevva/executable

Install

npm install executable
yarn add executable

executable Build Status

Check if a file is executable

Install

$ npm install --save executable

Usage

 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.

License

MIT © Kevin Mårtensson

Dependencies

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code