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

Class handeling the message communication with a parent process (the "other side" of a WatchChild). On construction, this class replace the console.log to an event dispatch (to have the parent process pipe those log to its stdout), and immediatly sends a ready message.

Constructors

new
WatchService()

Type Parameters

optional
IN_MESSAGE extends Message = Message
optional
OUT_MESSAGE extends Message = 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 parent process (as json piped in stdin)

Send a message to the parent process (as a json piped in stdout)

Start listening for messages