isexe

  • Version 3.1.1
  • Published
  • 43 kB
  • No dependencies
  • ISC license

Install

npm i isexe
yarn add isexe
pnpm add isexe

Overview

Minimal module to check if a file is executable.

Index

Functions

function isexe

isexe: (
path: string,
options?: import('./options.js').IsexeOptions
) => Promise<boolean>;
  • Determine whether a path is executable on the current platform.

function sync

sync: (path: string, options?: import('./options.js').IsexeOptions) => boolean;
  • Synchronously determine whether a path is executable on the current platform.

Interfaces

interface IsexeOptions

interface IsexeOptions {}

    property gid

    gid?: number;
    • effective gid when checking executable mode flags on posix Defaults to process.getgid()

    property groups

    groups?: number[];
    • effective group ID list to use when checking executable mode flags on posix Defaults to process.getgroups()

    property ignoreErrors

    ignoreErrors?: boolean;
    • Ignore errors arising from attempting to get file access status Note that EACCES is always ignored, because that just means it's not executable. If this is not set, then attempting to check the executable-ness of a nonexistent file will raise ENOENT, for example.

    property pathExt

    pathExt?: string;
    • The ;-delimited path extension list for win32 implementation. Defaults to process.env.PATHEXT

    property uid

    uid?: number;
    • effective uid when checking executable mode flags on posix Defaults to process.getuid()

    Namespaces

    namespace posix

    module 'dist/cjs/posix.d.ts' {}
    • This is the Posix implementation of isexe, which uses the file mode and uid/gid values.

    function isexe

    isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
    • Determine whether a path is executable according to the mode and current (or specified) user and group IDs.

    function sync

    sync: (path: string, options?: IsexeOptions) => boolean;
    • Synchronously determine whether a path is executable according to the mode and current (or specified) user and group IDs.

    namespace win32

    module 'dist/cjs/win32.d.ts' {}
    • This is the Windows implementation of isexe, which uses the file extension and PATHEXT setting.

    function isexe

    isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
    • Determine whether a path is executable based on the file extension and PATHEXT environment variable (or specified pathExt option)

    function sync

    sync: (path: string, options?: IsexeOptions) => boolean;
    • Synchronously determine whether a path is executable based on the file extension and PATHEXT environment variable (or specified pathExt option)

    Package Files (4)

    Dependencies (0)

    No dependencies.

    Dev Dependencies (11)

    Peer Dependencies (0)

    No peer dependencies.

    Badge

    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/isexe.

    • Markdown
      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/isexe)
    • HTML
      <a href="https://www.jsdocs.io/package/isexe"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>