@types/shell-quote

  • Version 1.7.5
  • Published
  • 6.09 kB
  • No dependencies
  • MIT license

Install

npm i @types/shell-quote
yarn add @types/shell-quote
pnpm add @types/shell-quote

Overview

TypeScript definitions for shell-quote

Index

Functions

function parse

parse: {
(
cmd: string,
env?: { readonly [key: string]: string },
opts?: ParseOptions
): ParseEntry[];
<T extends string | object>(
cmd: string,
env: (key: string) => T,
opts?: ParseOptions
): (T | ParseEntry)[];
};
  • Return an array of arguments from the quoted string cmd.

    Interpolate embedded bash-style $VARNAME and ${VARNAME} variables with the env object which like bash will replace undefined variables with "".

  • Return an array of arguments from the quoted string cmd.

    Interpolate embedded bash-style $VARNAME and ${VARNAME} variables with the env object which like bash will replace undefined variables with "".

    Parameter env

    A function to perform lookups. When env(key) returns a string, its result will be output just like env[key] would. When env(key) returns an object, it will be inserted into the result array like the operator objects.

function quote

quote: (args: readonly string[]) => string;
  • Return a quoted string for the array args suitable for using in shell commands.

Interfaces

interface ParseOptions

interface ParseOptions {}

    property escape

    escape?: string | undefined;
    • Custom escape character, default value is \

    Type Aliases

    type ControlOperator

    type ControlOperator =
    | '||'
    | '&&'
    | ';;'
    | '|&'
    | '<('
    | '>>'
    | '>&'
    | '&'
    | ';'
    | '('
    | ')'
    | '|'
    | '<'
    | '>';

      type ParseEntry

      type ParseEntry =
      | string
      | { op: ControlOperator }
      | { op: 'glob'; pattern: string }
      | { comment: string };

        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/shell-quote.

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