@types/npmcli__promise-spawn
Version:
TypeScript definitions for @npmcli/promise-spawn
59 lines (47 loc) • 1.85 kB
Markdown
# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/npmcli__promise-spawn/index.d.ts)
````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](https://npmjs.com/package/@types/node)
# Credits
These definitions were written by [Anton Golub](https://github.com/antongolub).