@zkochan/cmd-shim

  • Version 9.0.0
  • Published
  • 38.6 kB
  • 1 dependency
  • BSD-2-Clause license

Install

npm i @zkochan/cmd-shim
yarn add @zkochan/cmd-shim
pnpm add @zkochan/cmd-shim

Overview

Used in pnpm for command line application support

Index

Functions

function cmdShim

cmdShim: (src: string, to: string, opts?: Options) => Promise<void>;
  • Try to create shims.

    Parameter src

    Path to program (executable or script).

    Parameter to

    Path to shims. Don't add an extension if you will create multiple types of shims.

    Parameter opts

    Options.

    Throws

    If src is missing.

function cmdShimIfExists

cmdShimIfExists: (src: string, to: string, opts?: Options) => Promise<void>;
  • Try to create shims.

    Does nothing if src doesn't exist.

    Parameter src

    Path to program (executable or script).

    Parameter to

    Path to shims. Don't add an extension if you will create multiple types of shims.

    Parameter opts

    Options.

function isShimPointingAt

isShimPointingAt: (shimContent: string, src: string) => boolean;
  • Check whether a shim's content points at the given source path.

    Parameter shimContent

    The text content of the shim file.

    Parameter src

    The expected source path (the executable the shim should point to). true if the shim contains a matching target marker.

Interfaces

interface Options

interface Options {}

    property args

    args?: string;
    • The arguments to initialize the node process with.

    property createCmdFile

    createCmdFile?: boolean;
    • If a Windows Command Prompt script should be created.

      false

    property createPwshFile

    createPwshFile?: boolean;
    • If a PowerShell script should be created.

      true

    property fs

    fs?: typeof import('fs');
    • fs implementation to use. Must implement node's fs module interface.

    property nodeExecPath

    nodeExecPath?: string;

      property nodePath

      nodePath?: string | string[];
      • The value of the $NODE_PATH environment variable.

        The single string format is only kept for legacy compatibility, and the array form should be preferred.

      property prependToPath

      prependToPath?: string;
        preserveSymlinks?: boolean;
        • If symbolic links should be preserved.

          false

        property prog

        prog?: string;
        • The path to the executable file.

        property progArgs

        progArgs?: string[];
        • The arguments to initialize the target process with, before the actual CLI arguments

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (4)

        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/@zkochan/cmd-shim.

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