@types/which

  • Version 2.0.1
  • Published
  • 5.98 kB
  • No dependencies
  • MIT license

Install

npm i @types/which
yarn add @types/which
pnpm add @types/which

Overview

TypeScript definitions for which

Index

Functions

function sync

sync: {
(
cmd: string,
options: Options & OptionsAll & OptionsNoThrow
): ReadonlyArray<string> | null;
(cmd: string, options: Options & OptionsFirst & OptionsNoThrow): string;
(cmd: string, options: Options & OptionsAll & OptionsThrow): readonly string[];
(cmd: string, options?: Options & OptionsFirst & OptionsThrow): string;
(cmd: string, options: Options): string | readonly string[];
};
  • Finds all instances of a specified executable in the PATH environment variable

function which

which: typeof which;
  • Finds all instances of a specified executable in the PATH environment variable

Interfaces

interface AsyncOptions

interface AsyncOptions {}
  • Options for which() async API

property all

all?: boolean | undefined;
  • If true, return all matches, instead of just the first one. Note that this means the function returns an array of strings instead of a single string.

property path

path?: string | undefined;
  • Use instead of the PATH environment variable.

property pathExt

pathExt?: string | undefined;
  • Use instead of the PATHEXT environment variable.

interface Options

interface Options extends AsyncOptions {}
  • Options for which() sync and async APIs

property nothrow

nothrow?: boolean | undefined;
  • If true, returns null when not found

interface OptionsAll

interface OptionsAll extends AsyncOptions {}
  • Options that ask for all matches.

property all

all: true;

    interface OptionsFirst

    interface OptionsFirst extends AsyncOptions {}
    • Options that ask for the first match (the default behavior)

    property all

    all?: false | undefined;

      interface OptionsNoThrow

      interface OptionsNoThrow extends Options {}
      • Options that ask to receive null instead of a thrown error

      property nothrow

      nothrow: true;

        interface OptionsThrow

        interface OptionsThrow extends Options {}
        • Options that ask for a thrown error if executable is not found (the default behavior)

        property nothrow

        nothrow?: false | undefined;

          Package Files (1)

          Dependencies (0)

          No dependencies.

          Dev Dependencies (0)

          No dev dependencies.

          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/@types/which.

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