@@ -86,6 +86,22 @@ Send a signal to a child process. It's an unfortunate historical decision
86
86
that this function is called "kill", as sending a signal to a child
87
87
process won't necessarily kill it.
88
88
89
+ #### ` ChildProcessExit `
90
+
91
+ ``` purescript
92
+ data ChildProcessExit
93
+ = Normally Int
94
+ | BySignal Signal
95
+ ```
96
+
97
+ Specifies how a child process exited; normally (with an exit code), or
98
+ due to a signal.
99
+
100
+ ##### Instances
101
+ ``` purescript
102
+ Show ChildProcessExit
103
+ ```
104
+
89
105
#### ` SpawnOptions `
90
106
91
107
``` purescript
@@ -95,13 +111,13 @@ type SpawnOptions = { cwd :: Maybe String, stdio :: Array (Maybe StdIOBehaviour)
95
111
#### ` onExit `
96
112
97
113
``` purescript
98
- onExit :: forall eff. ChildProcess -> (Maybe Int -> Maybe Signal -> Eff eff Unit) -> Eff eff Unit
114
+ onExit :: forall eff. ChildProcess -> (ChildProcessExit -> Eff eff Unit) -> Eff eff Unit
99
115
```
100
116
101
117
#### ` onClose `
102
118
103
119
``` purescript
104
- onClose :: forall eff. ChildProcess -> (Maybe Int -> Maybe Signal -> Eff eff Unit) -> Eff eff Unit
120
+ onClose :: forall eff. ChildProcess -> (ChildProcessExit -> Eff eff Unit) -> Eff eff Unit
105
121
```
106
122
107
123
#### ` onMessage `
@@ -128,6 +144,21 @@ onError :: forall eff. ChildProcess -> (ChildProcessError -> Eff eff Unit) -> Ef
128
144
spawn :: forall eff. String -> Array String -> SpawnOptions -> Eff (cp :: CHILD_PROCESS | eff) ChildProcess
129
145
```
130
146
147
+ Spawn a child process. Note that, in the event that a child process could
148
+ not be spawned (for example, if the executable was not found) this will
149
+ not throw an error. Instead, the ` ChildProcess ` will be created anyway,
150
+ but it will immediately emit an 'error' event.
151
+
152
+ #### ` fork `
153
+
154
+ ``` purescript
155
+ fork :: forall eff. String -> Array String -> Eff (cp :: CHILD_PROCESS | eff) ChildProcess
156
+ ```
157
+
158
+ A special case of ` spawn ` for creating Node.js child processes. The first
159
+ argument is the module to be run, and the second is the argv (command line
160
+ arguments).
161
+
131
162
#### ` defaultSpawnOptions `
132
163
133
164
``` purescript
@@ -146,6 +177,10 @@ An error which occurred inside a child process.
146
177
147
178
``` purescript
148
179
data StdIOBehaviour
180
+ = Pipe
181
+ | Ignore
182
+ | ShareStream (forall r eff a. Stream r eff a)
183
+ | ShareFD FileDescriptor
149
184
```
150
185
151
186
Behaviour for standard IO streams (eg, standard input, standard output) of
@@ -161,4 +196,28 @@ a child process.
161
196
* ` ShareFD ` : Connect the supplied file descriptor (which should be open
162
197
in the parent) to the corresponding file descriptor in the child.
163
198
199
+ #### ` pipe `
200
+
201
+ ``` purescript
202
+ pipe :: Array (Maybe StdIOBehaviour)
203
+ ```
204
+
205
+ Create pipes for each of the three standard IO streams.
206
+
207
+ #### ` inherit `
208
+
209
+ ``` purescript
210
+ inherit :: Array (Maybe StdIOBehaviour)
211
+ ```
212
+
213
+ Share stdin with stdin, stdout with stdout, and stderr with stderr.
214
+
215
+ #### ` ignore `
216
+
217
+ ``` purescript
218
+ ignore :: Array (Maybe StdIOBehaviour)
219
+ ```
220
+
221
+ Ignore all streams.
222
+
164
223
0 commit comments