@types/npmcli__promise-spawn
TypeScript icon, indicating that this package has built-in type declarations

6.0.3 • Public • Published

Installation

npm install --save @types/npmcli__promise-spawn

Summary

This package contains type definitions for @npmcli/promise-spawn (https://github.com/npm/promise-spawn#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/npmcli__promise-spawn.

index.d.ts

/// <reference types="node" />

import { spawn, SpawnOptions } from "child_process";

type NativeSpawnResult = ReturnType<typeof spawn>;

type SpawnResult<Output, Extra> =
    & Promise<
        {
            cmd: string;
            args: string[];
            code: number;
            signal: NodeJS.Signals | null;
            stdout: Output;
            stderr: Output;
        } & Extra
    >
    & { process: NativeSpawnResult; stdio: NativeSpawnResult["stdio"] };

type PromiseSpawnOptions = {
    cwd?: string;
    stdioString?: boolean;
} & SpawnOptions;

declare const promiseSpawn: {
    <O extends PromiseSpawnOptions = PromiseSpawnOptions>(
        cmd: string,
        args: string[],
        opts?: O,
        extra?: Record<any, any>,
    ): SpawnResult<O extends { stdioString: false } ? Buffer : string, typeof extra>;
    open<O extends PromiseSpawnOptions & { command?: string } = PromiseSpawnOptions & { command?: string }>(
        args: string | string[],
        opts?: O,
        extra?: Record<any, any>,
    ): SpawnResult<O extends { stdioString: false } ? Buffer : string, typeof extra>;
};

export = promiseSpawn;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Anton Golub.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/npmcli__promise-spawn

Weekly Downloads

2,948

Version

6.0.3

License

MIT

Unpacked Size

5.01 kB

Total Files

5

Last publish

Collaborators

  • types