GithubHelp home page GithubHelp logo

hugoalh-studio / is-executable-es Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 19 KB

An ES (JavaScript & TypeScript) module to determine whether the file is executable.

License: Other

TypeScript 100.00%
executable is ts typescript es javascript js modulejs

is-executable-es's Introduction

Is Executable (TypeScript)

โš–๏ธ MIT

๐Ÿ—‚๏ธ GitHub: hugoalh-studio/is-executable-ts JSR: @hugoalh/is-executable

๐Ÿ†™ Latest Release Version (Latest Release Date)

A TypeScript module to determine whether the file is executable.

๐ŸŽฏ Target

  • Bun ^ v1.0.0
  • Deno >= v1.34.0 / >= v1.41.1 (Via JSR)

    ๐Ÿ›ก๏ธ Require Permission

    • Environment (allow-env)
      • PATHEXT (For Windows Only)
    • File System - Read (allow-read)
    • System Info (allow-sys)
      • gid (For Non-Windows Only)
      • uid (For Non-Windows Only)
  • NodeJS >= v16.13.0

๐Ÿ”ฐ Usage

Via HTTPS

๐ŸŽฏ Supported Target

  • Deno
  1. Import at the script (<ScriptName>.ts):
    • Via DenoPKG
      import ... from "https://denopkg.com/hugoalh-studio/is-executable-ts[@<Tag>]/mod.ts";
    • Via GitHub Raw (Require Tag)
      import ... from "https://raw.githubusercontent.com/hugoalh-studio/is-executable-ts/<Tag>/mod.ts";
    • Via Pax
      import ... from "https://pax.deno.dev/hugoalh-studio/is-executable-ts[@<Tag>]/mod.ts";

    โ„น๏ธ Note

    Although it is recommended to import the entire module with the main path mod.ts, it is also able to import part of the module with sub path if available, but do not import if:

    • it's file path has an underscore prefix (e.g.: _foo.ts, _util/bar.ts), or
    • it is a benchmark or test file (e.g.: foo.bench.ts, foo.test.ts), or
    • it's symbol has an underscore prefix (e.g.: export function _baz() {}).

    These elements are not considered part of the public API, thus no stability is guaranteed for them.

Via JSR With Native Support

๐ŸŽฏ Supported Target

  • Deno
  1. Import at the script (<ScriptName>.ts):
    import ... from "jsr:@hugoalh/is-executable[@<Tag>]";

    โ„น๏ธ Note

    Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.

Via JSR With NPM Compatibility Layer Support

๐ŸŽฏ Supported Target

  • Bun
  • NodeJS
  1. Install via console/shell/terminal:
    • Via Bun
      bunx jsr add @hugoalh/is-executable[@<Tag>]
    • Via NPM
      npx jsr add @hugoalh/is-executable[@<Tag>]
    • Via PNPM
      pnpm dlx jsr add @hugoalh/is-executable[@<Tag>]
    • Via Yarn
      yarn dlx jsr add @hugoalh/is-executable[@<Tag>]
  2. Import at the script (<ScriptName>.ts):
    import ... from "@hugoalh/is-executable";

    โ„น๏ธ Note

    Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.

๐Ÿงฉ API

  • function isExecutable(filePath: string, options: IsExecutableOptions = {}): Promise<boolean>;
  • interface IsExecutableOptions {
      /**
      * If the file is not exist, whether to return `false` instead of throw an error.
      * @default false
      */
      mayNotExist?: boolean;
      /**
      * Effective group ID to check executable mode flags on POSIX system. Default to the group ID of the current process.
      */
      gid?: number;
      /**
      * Effective user ID to check executable mode flags on POSIX system. Default to the user ID of the current process.
      */
      uid?: number;
    }

โ„น๏ธ Note

For the prettier documentation, can visit via:

is-executable-es's People

Contributors

hugoalh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.