(path: string, options?: EntryOptions): (
token: string
) => ChildProcess.CommandEntry-path sugar over command — exec + execArgs + path, with the same token injection.
constructorscommand
Source src/internal/launcher.ts:35613 lines
export const const entry: (
path: string,
options?: EntryOptions
) => (token: string) => ChildProcess.Command
Entry-path sugar over
command
— exec + execArgs + path, with the same token injection.
entry = (
path: stringpath: string,
options: EntryOptionsoptions?: EntryOptions,
): ((token: stringtoken: string) => import ChildProcessChildProcess.type Command =
| ChildProcess.StandardCommand
| ChildProcess.PipedCommand
A command that can be built using make, combined using pipeTo, and executed using exec or spawn.
Command) => {
const const exec: stringexec = options: EntryOptionsoptions?.EntryOptions.exec?: string | undefinedExecutable. Default "node".
exec ?? "node";
const const execArgs: readonly string[]execArgs = options: EntryOptionsoptions?.EntryOptions.execArgs?: readonly string[] | undefinedArgs before the entry path (e.g. ["exec", "tsx"] with exec: "pnpm").
execArgs ?? [];
const {
EntryOptions.exec?: string | undefinedExecutable. Default "node".
exec: const _exec: string | undefinedExecutable. Default "node".
_exec,
EntryOptions.execArgs?: readonly string[] | undefinedArgs before the entry path (e.g. ["exec", "tsx"] with exec: "pnpm").
execArgs: const _execArgs:
| readonly string[]
| undefined
Args before the entry path (e.g. ["exec", "tsx"] with exec: "pnpm").
_execArgs,
...const commandOpts: {
token?: TokenInjection
tokenArgvAt?: number
cwd?: string | undefined
env?:
| Record<string, string | undefined>
| undefined
extendEnv?: boolean | undefined
shell?: boolean | string | undefined
detached?: boolean | undefined
stdin?:
| ChildProcess.CommandInput
| ChildProcess.StdinConfig
| undefined
stdout?:
| ChildProcess.CommandOutput
| ChildProcess.StdoutConfig
| undefined
stderr?:
| ChildProcess.CommandOutput
| ChildProcess.StderrConfig
| undefined
additionalFds?:
| Record<
`fd${number}`,
ChildProcess.AdditionalFdConfig
>
| undefined
killSignal?: ChildProcess.Signal | undefined
forceKillAfter?: Duration.Input | undefined
}
commandOpts
} = options: EntryOptionsoptions ?? {};
return const command: (
cmd: string,
args?: ReadonlyArray<string>,
options?: CommandOptions
) => (token: string) => ChildProcess.Command
Build a SpawnSpec.process factory that injects the assume token into env and/or argv.
command(const exec: stringexec, [...const execArgs: readonly string[]execArgs, path: stringpath], const commandOpts: {
token?: TokenInjection
tokenArgvAt?: number
cwd?: string | undefined
env?:
| Record<string, string | undefined>
| undefined
extendEnv?: boolean | undefined
shell?: boolean | string | undefined
detached?: boolean | undefined
stdin?:
| ChildProcess.CommandInput
| ChildProcess.StdinConfig
| undefined
stdout?:
| ChildProcess.CommandOutput
| ChildProcess.StdoutConfig
| undefined
stderr?:
| ChildProcess.CommandOutput
| ChildProcess.StderrConfig
| undefined
additionalFds?:
| Record<
`fd${number}`,
ChildProcess.AdditionalFdConfig
>
| undefined
killSignal?: ChildProcess.Signal | undefined
forceKillAfter?: Duration.Input | undefined
}
commandOpts);
};