Package-level declarations

Types

Link copied to clipboard
open external class ChildProcess : EventEmitter

Instances of the ChildProcess represent spawned child processes.

Link copied to clipboard
sealed external interface ChildProcessByStdio<I : Writable?, O : Readable?, E : Readable?> : ChildProcess
Link copied to clipboard
sealed external interface ChildProcessWithoutNullStreams : ChildProcess
Link copied to clipboard
sealed external interface CommonExecOptions : CommonOptions
Link copied to clipboard
sealed external interface CommonOptions : ProcessEnvOptions
Link copied to clipboard
sealed external interface CommonSpawnOptions : CommonOptions, MessagingOptions, <ERROR CLASS> ERROR CLASS: Symbol not found for Abortable
Link copied to clipboard
sealed external interface ExecException : <ERROR CLASS> ERROR CLASS: Symbol not found for js.errors.JsError
Link copied to clipboard
sealed external interface ExecFileException : ExecException, ErrnoException
Link copied to clipboard
sealed external interface ExecFileOptions : CommonOptions, <ERROR CLASS> ERROR CLASS: Symbol not found for Abortable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface ExecFileSyncOptions : CommonExecOptions
Link copied to clipboard
sealed external interface ExecOptions : CommonOptions
Link copied to clipboard
sealed external interface ExecOptionsWithBufferEncoding : ExecOptions
Link copied to clipboard
sealed external interface ExecOptionsWithStringEncoding : ExecOptions
Link copied to clipboard
sealed external interface ExecSyncOptions : CommonExecOptions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface ForkOptions : ProcessEnvOptions, MessagingOptions, <ERROR CLASS> ERROR CLASS: Symbol not found for Abortable
Link copied to clipboard
sealed external interface IOType
Link copied to clipboard
sealed external interface MessageOptions
Link copied to clipboard
sealed external interface MessagingOptions : <ERROR CLASS> ERROR CLASS: Symbol not found for Abortable
Link copied to clipboard
sealed external interface ProcessEnvOptions
Link copied to clipboard
sealed external interface PromiseWithChild<T> : <ERROR CLASS> ERROR CLASS: Symbol not found for Promise<T>
Link copied to clipboard
typealias SendHandle = Any?
Link copied to clipboard
typealias Serializable = Any
Link copied to clipboard
sealed external interface SerializationType
Link copied to clipboard
sealed external interface SpawnOptions : CommonSpawnOptions
Link copied to clipboard
sealed external interface SpawnOptionsWithoutStdio : SpawnOptions
Link copied to clipboard
Link copied to clipboard
sealed external interface SpawnSyncOptions : CommonSpawnOptions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface SpawnSyncReturns<T>
Link copied to clipboard
typealias StdioNull = Any
Link copied to clipboard
typealias StdioOptions = Any
Link copied to clipboard
Link copied to clipboard
sealed external interface StdioPipeNamed

Functions

Link copied to clipboard
external fun exec(command: String, callback: (error: ExecException?, stdout: String, stderr: String) -> Unit = definedExternally): ChildProcess

Spawns a shell then executes the command within that shell, buffering any generated output. The command string passed to the exec function is processed directly by the shell and special characters (vary based on shell) need to be dealt with accordingly:

external fun exec(command: String, options: ExecOptions?, callback: (error: ExecException?, stdout: Any, stderr: Any) -> Unit = definedExternally): ChildProcess
external fun exec(command: String, options: ExecOptionsWithBufferEncoding, callback: (error: ExecException?, stdout: Buffer<*>, stderr: Buffer<*>) -> Unit = definedExternally): ChildProcess
external fun exec(command: String, options: ExecOptionsWithStringEncoding, callback: (error: ExecException?, stdout: String, stderr: String) -> Unit = definedExternally): ChildProcess
Link copied to clipboard
external fun execFile(file: String, callback: (error: ExecFileException?, stdout: String, stderr: String) -> Unit = definedExternally): ChildProcess

The child_process.execFile() function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified executable file is spawned directly as a new process making it slightly more efficient than {@link exec}.

external fun execFile(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>??, callback: (error: ExecFileException?, stdout: String, stderr: String) -> Unit = definedExternally): ChildProcess
external fun execFile(file: String, options: ExecFileOptions?, callback: (error: ExecFileException?, stdout: Any, stderr: Any) -> Unit?): ChildProcess
external fun execFile(file: String, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException?, stdout: Buffer<*>, stderr: Buffer<*>) -> Unit = definedExternally): ChildProcess
external fun execFile(file: String, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException?, stdout: String, stderr: String) -> Unit = definedExternally): ChildProcess
external fun execFile(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>??, options: ExecFileOptions?, callback: (error: ExecFileException?, stdout: Any, stderr: Any) -> Unit?): ChildProcess
external fun execFile(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>??, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException?, stdout: Buffer<*>, stderr: Buffer<*>) -> Unit = definedExternally): ChildProcess
external fun execFile(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>??, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException?, stdout: String, stderr: String) -> Unit = definedExternally): ChildProcess
Link copied to clipboard
external fun execFileSync(file: String): Buffer<*>

The child_process.execFileSync() method is generally identical to {@link execFile} with the exception that the method will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited.

external fun execFileSync(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>): Buffer<*>
external fun execFileSync(file: String, options: ExecFileSyncOptions = definedExternally): Any
external fun execFileSync(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String> = definedExternally, options: ExecFileSyncOptions = definedExternally): Any
external fun execFileSync(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: ExecFileSyncOptionsWithBufferEncoding): Buffer<*>
external fun execFileSync(file: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: ExecFileSyncOptionsWithStringEncoding): String
Link copied to clipboard
external fun execSync(command: String): Buffer<*>

The child_process.execSync() method is generally identical to {@link exec} with the exception that the method will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited. If the child process intercepts and handles the SIGTERM signal and doesn't exit, the parent process will wait until the child process has exited.

external fun execSync(command: String, options: ExecSyncOptions = definedExternally): Any
external fun execSync(command: String, options: ExecSyncOptionsWithBufferEncoding): Buffer<*>
external fun execSync(command: String, options: ExecSyncOptionsWithStringEncoding): String
Link copied to clipboard
external fun fork(modulePath: ERROR CLASS: Symbol not found for URL): ChildProcess
external fun fork(modulePath: ERROR CLASS: Symbol not found for URL, options: ForkOptions = definedExternally): ChildProcess
external fun fork(modulePath: String, options: ForkOptions = definedExternally): ChildProcess

The child_process.fork() method is a special case of {@link spawn} used specifically to spawn new Node.js processes. Like {@link spawn}, a ChildProcess object is returned. The returned ChildProcess will have an additional communication channel built-in that allows messages to be passed back and forth between the parent and child. See subprocess.send() for details.

external fun fork(modulePath: String): ChildProcess
external fun fork(modulePath: ERROR CLASS: Symbol not found for URL, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String> = definedExternally, options: ForkOptions = definedExternally): ChildProcess
external fun fork(modulePath: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String> = definedExternally, options: ForkOptions = definedExternally): ChildProcess
Link copied to clipboard
external fun spawn(command: String, options: SpawnOptions): ChildProcess
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptions): ChildProcess
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>): ChildProcessByStdio<Nothing?, Nothing?, Nothing?>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe?>): ChildProcessByStdio<Nothing?, Nothing?, Readable>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe?, StdioNull>): ChildProcessByStdio<Nothing?, Readable, Nothing?>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe?, StdioPipe?>): ChildProcessByStdio<Nothing?, Readable, Readable>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioPipe?, StdioNull, StdioNull>): ChildProcessByStdio<Writable, Nothing?, Nothing?>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioPipe?, StdioNull, StdioPipe?>): ChildProcessByStdio<Writable, Nothing?, Readable>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioPipe?, StdioPipe?, StdioNull>): ChildProcessByStdio<Writable, Readable, Nothing?>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnOptionsWithStdioTuple<StdioPipe?, StdioPipe?, StdioPipe?>): ChildProcessByStdio<Writable, Readable, Readable>
external fun spawn(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String> = definedExternally, options: SpawnOptionsWithoutStdio = definedExternally): ChildProcessWithoutNullStreams

external fun spawn(command: String, options: SpawnOptionsWithoutStdio = definedExternally): ChildProcessWithoutNullStreams

The child_process.spawn() method spawns a new process using the given command, with command-line arguments in args. If omitted, args defaults to an empty array.

Link copied to clipboard
external fun spawnSync(command: String): SpawnSyncReturns<Buffer<*>>

The child_process.spawnSync() method is generally identical to {@link spawn} with the exception that the function will not return until the child process has fully closed. When a timeout has been encountered and killSignal is sent, the method won't return until the process has completely exited. If the process intercepts and handles the SIGTERM signal and doesn't exit, the parent process will wait until the child process has exited.

external fun spawnSync(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>): SpawnSyncReturns<Buffer<*>>
external fun spawnSync(command: String, options: SpawnSyncOptions = definedExternally): SpawnSyncReturns<Any>
external fun spawnSync(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String> = definedExternally, options: SpawnSyncOptions = definedExternally): SpawnSyncReturns<Any>
external fun spawnSync(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer<*>>
external fun spawnSync(command: String, args: ERROR CLASS: Symbol not found for ReadonlyArray<kotlin/String>, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<String>