process.stdin
process.stdin
Function
Sets the text to be written to the child process's standard input.
Syntax
process(program).stdin(text)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| text | Any | No | Null | Standard input text. |
Return value
| Type | Description |
|---|---|
| Process | Returns the new process builder. |
Example
cmd = process('cmd').stdin('BT') result = type(cmd) // Output: Process print result
Notes
- After setting stdin, child() uses piped mode to write text and close the stdin pipe.
- stdin(text) only configures the text to be written; the actual writing occurs when child() starts the child process.
- When stdin(text) is not set, child() closes the child process stdin by default and does not inherit the parent process stdin.