Module Node.ChildProcess

type t
module Options : sig ... end
type return = {
  1. exitCode : int;
  2. stdout : string;
  3. stderr : string;
}
type event =
  1. | Spawned
  2. | Stdout of string
  3. | Stderr of string
  4. | Closed
  5. | ProcessError of JsError.t

Low-level API for long-running processes

val spawn_process : string -> string array -> ?options:Options.t -> unit -> t
val get_stdout : t -> Stream.Readable.t
val get_stderr : t -> Stream.Readable.t
val kill : t -> ?signal:string -> unit -> unit
val on : t -> [ `Close of code:int -> ?signal:string -> unit -> unit | `Disconnect of unit -> unit | `Error of err:JsError.t -> unit | `Exit of code:int -> ?signal:string -> unit -> unit ] -> unit

High-level API that waits for process to complete

val exec : ?logger:(event -> unit) -> ?stdin:string -> ?options:Options.t -> string -> return Promise.t
val spawn : ?logger:(event -> unit) -> ?stdin:string -> ?options:Options.t -> string -> string array -> return Promise.t