Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class WatchChild
import { WatchChild } from "https://deno.land/x/frugal@0.2.1/packages/core/watch/WatchChild.ts";

Spawn a child process, listen for messages in stdout/stderr and dispatches messages to stdin.

Constructors

new
WatchChild(cmd: string | URL, config: WatchChildConfig)

Type Parameters

IN_MESSAGE extends Message
OUT_MESSAGE extends Message

Methods

addEventListener<EVENT extends EventNames<EventMap<IN_MESSAGE>>>(
event: EVENT,
listener: Listener<EventMap<IN_MESSAGE>[EVENT]>,
config?: { once?: boolean; },
): () => void

Listen to messages from the child process (as json piped in stdout/stderr)

Send a message to the child process (as a json piped in stdin)

Spawn the child process and start listening for messages

Stop the chils process (with SIGTERM)