Skip to content

Commit ce57d86

Browse files
authored
docs: add options documentation (#5)
1 parent e8047c3 commit ce57d86

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ for await (const line of result) {
3232
}
3333
```
3434

35+
### Options
36+
37+
Options can be passed to have finer control over spawning of the process:
38+
39+
```ts
40+
await x('ls', [], {
41+
timeout: 1000
42+
});
43+
```
44+
45+
The options object can have the following properties:
46+
47+
- `signal` - an `AbortSignal` to allow aborting of the execution
48+
- `timeout` - time in milliseconds at which the process will be forceably killed
49+
- `persist` - if `true`, the process will continue after the host exits
50+
- `stdin` - another `Result` can be used as the input to this process
51+
- `nodeOptions` - any valid options to node's underlying `spawn` function
52+
3553
### Piping to another process
3654

3755
You can pipe a process to another via the `pipe` method:

0 commit comments

Comments
 (0)