@types/command-line-commands
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

Installation

npm install --save @types/command-line-commands

Summary

This package contains type definitions for command-line-commands (https://github.com/75lb/command-line-commands).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/command-line-commands.

index.d.ts

/**
 * Parses the `argv` value supplied (or `process.argv` by default), extracting and returning the `command` and remainder of `argv`. The command will be the first value in the `argv` array unless it is an option (e.g. `--help`).
 *
 * @param {string|string[]} - One or more command strings, one of which the user must supply. Include `null` to represent "no command" (effectively making a command optional).
 * @param [argv] {string[]} - An argv array, defaults to the global `process.argv` if not supplied.
 * @returns {{ command: string, argv: string[] }}
 * @throws `INVALID_COMMAND` - user supplied a command not specified in `commands`.
 */
declare function commandLineCommands(
    commands: Array<string | null>,
    argv?: string[],
): { command: string | null; argv: string[] };

export = commandLineCommands;

Additional Details

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

Credits

These definitions were written by CzBuCHi.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/command-line-commands

Weekly Downloads

652

Version

2.0.5

License

MIT

Unpacked Size

4.27 kB

Total Files

5

Last publish

Collaborators

  • types