@types/shell-quote
TypeScript definitions for shell-quote
Last updated 7 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/shell-quote 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/shell-quote

Summary

This package contains type definitions for shell-quote (https://github.com/substack/node-shell-quote).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/shell-quote.

index.d.ts

export type ControlOperator = "||" | "&&" | ";;" | "|&" | "<(" | ">>" | ">&" | "&" | ";" | "(" | ")" | "|" | "<" | ">";

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

export interface ParseOptions {
    /**
     * Custom escape character, default value is `\`
     */
    escape?: string | undefined;
}

/**
 * Return a quoted string for the array `args` suitable for using in shell commands.
 */
export function quote(args: readonly string[]): string;

/**
 * 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 `""`.
 */
export function parse(
    cmd: string,
    env?: { readonly [key: string]: string | undefined },
    opts?: ParseOptions,
): 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 `""`.
 *
 * @param 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.
 */
export function parse<T extends object | string>(
    cmd: string,
    env: (key: string) => T | undefined,
    opts?: ParseOptions,
): Array<ParseEntry | T>;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Jason Cheatham, Cameron Diver, and Opportunity Liu.

Current Tags

  • 1.7.5                                ...           latest (2 years ago)
  • 1.6.1                                ...           ts2.2 (7 years ago)
  • 1.6.1                                ...           ts2.3 (7 years ago)
  • 1.6.1                                ...           ts2.4 (7 years ago)
  • 1.6.1                                ...           ts2.5 (7 years ago)
  • 1.6.1                                ...           ts2.6 (7 years ago)
  • 1.6.1                                ...           ts2.7 (7 years ago)
  • 1.6.1                                ...           ts2.8 (7 years ago)
  • 1.6.1                                ...           ts2.9 (7 years ago)
  • 1.7.0                                ...           ts3.0 (6 years ago)
  • 1.7.0                                ...           ts3.1 (6 years ago)
  • 1.7.0                                ...           ts3.2 (6 years ago)
  • 1.7.0                                ...           ts3.3 (6 years ago)
  • 1.7.0                                ...           ts3.4 (6 years ago)
  • 1.7.0                                ...           ts3.5 (6 years ago)
  • 1.7.1                                ...           ts3.6 (5 years ago)
  • 1.7.1                                ...           ts3.7 (5 years ago)
  • 1.7.1                                ...           ts3.8 (5 years ago)
  • 1.7.1                                ...           ts3.9 (5 years ago)
  • 1.7.1                                ...           ts4.0 (5 years ago)
  • 1.7.1                                ...           ts4.1 (5 years ago)
  • 1.7.1                                ...           ts4.2 (5 years ago)
  • 1.7.1                                ...           ts4.3 (5 years ago)
  • 1.7.1                                ...           ts4.4 (5 years ago)
  • 1.7.5                                ...           ts4.5 (2 years ago)
  • 1.7.5                                ...           ts4.6 (2 years ago)
  • 1.7.5                                ...           ts4.7 (2 years ago)
  • 1.7.5                                ...           ts4.8 (2 years ago)
  • 1.7.5                                ...           ts4.9 (2 years ago)
  • 1.7.5                                ...           ts5.0 (2 years ago)
  • 1.7.5                                ...           ts5.1 (2 years ago)
  • 1.7.5                                ...           ts5.2 (2 years ago)
  • 1.7.5                                ...           ts5.3 (2 years ago)
  • 1.7.5                                ...           ts5.4 (2 years ago)
  • 1.7.5                                ...           ts5.5 (2 years ago)
  • 1.7.5                                ...           ts5.6 (2 years ago)
  • 1.7.5                                ...           ts5.7 (2 years ago)
  • 1.7.5                                ...           ts5.8 (2 years ago)
  • 1.7.5                                ...           ts5.9 (2 years ago)

9 Versions

  • 1.7.5                                ...           2 years ago
  • 1.7.4                                ...           2 years ago
  • 1.7.3                                ...           2 years ago
  • 1.7.2                                ...           3 years ago
  • 1.7.1                                ...           5 years ago
  • 1.7.0                                ...           6 years ago
  • 1.6.2                                ...           6 years ago
  • 1.6.1                                ...           7 years ago
  • 1.6.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |